implmented JSHint and put in mocha structure

due to the recent surge of bugs and errors ( #2 #3 ), I have integrated JSHint and mocha into this project.
Since i pull this straight out of one of my other projects mocha comes along as well.

I have an idea of what unit tests we could write to prevent issues in future, however i don't want to put that up with this PR as the linting right now is essential for development.