Added grunt, mocha and phantomjs.
Added tests task for grunt.
Added proper DOM tests.
Fixed the first DOM test. Cleaned up logging.
Wrote a test to check that dom nodes were being created. Fixed code to use deferred promises were needed.
Merge branch 'feature/tests' into develop