phantomjs: general tweaks and cleanup.