Simplify PhantomJS test completion detection

Also do some general cleanup and documentation. Code from PhantomJS has been
removed so get rid of the license info.