Test with PhantomJS. Closes #593