Select the engine according to the JDK

When the setting "script.javascript.engine" is not specified or equal to
"auto", the engine selected depends on the Java version: Nashorn for Java
8 and Rhino for Java 6 and 7.

Also take extra care to not load the nashorn or rhino classes
at all if the engine is not selected.
Trivial cleanup