Welcome to my submission!
I'd like to quickly note that I've commented on here WAY more than I usually would, for the purposes of this being a test.
I am a strong believer that comments should only say "why" and not "what" - reading the code should tell you what it does!
I enjoyed this test and hope I've managed to keep to the spec.
There are a few things I would change given more time but I didn't want to overdo it.
Thanks!