Respectfully, I must disagree with the OP's comments above. Whilst I am by no means a 'guru' (I don't believe such people exist - if you ever think you've nothing left to learn, heaven help you), I have taken the same test myself. I had to contain how much I could do, as I was asked to do the test over the weekend. To diagnose, check some question marks over the requirements, design, test, refactor best I could in the time frame, create a suitable readme, refactor again after a break to give my eyes a rest, pull together and check the build worked and matched the instructions in the readme, packaged up, and sent back, took a tad longer than four hours.
I haven't heard back from the company yet, but I would challenge the assertion that the OP wasted their time. Treat it as an opportunity to have put your mind to work in solving the problem and as a chance to go back now and review your own code against best practice.
Neither the OP nor myself can make a valid statement on how the company treats its employees based on the experience of a code test.
To any and all individuals interested in submitting an application, I would encourage you to do so. The experience I have had (as at time of writing, engaging with the HR manager to ensure I understood the requirements as best I could) has been extremely positive.