Added tests and fixed a few bugs found by tests
Added grunt
Merge pull request #1 from lightswitch05/feature/testing

Added QUnit tests and fixed bugs