Added maximum days in month check.

I've added a function and switch statement to sort the months and check you aren't requesting impossible days, which might be useful for finding bugs in programmes that use the api.
I've not fully tested it due to lack of a web server, so sorry for any inconvenience, but please check it works first. :)