Add factories to sbt plugin for PhantomJSEnv and NodeJSEnv

This hopefully simplifies build definitions that need to tweak some
command line options or just force a given environment.

At the same time, this also fixes #1302 (use proper class loader for
PhantomJSEnv in our CI).