Fix tests failing under phantomjs.
Add .travis.yml