Fixing broken unit tests and switching to PhantomJS for testing