Added error check earlier in test
Added phantomjs install to travis file