Fixed issue where test were running twice in PhantomJS. Also cleaned up formatting