Making JS console and macros work in Java 8 (Nashorn) as well as pre-Java 8 (Rhino)