Provide Nashorn-like extensions with JSAdapter.

See https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions