Moar unit tests

TDD/BDD FTW!

Now with:
* valid jshint config, scoped for unit tests only
* simple tests for validations
* minor syntax fixes for related code