Fixed npm scripts
Configured phantomjs for tests. Tidied up gruntfile a little.
Removed debugging console.* call.
Refactored code slightly and added some comments.