Run tests with PhantomJS

So Travis-CI can do our tests.
Fix test error