Add headless test support with PhantomJS