Please review http://cr.openjdk.java.net/~sundar/8158131/ for https://bugs.openjdk.java.net/browse/JDK-8158131
This code cleanup is to avoid Nashorn's use of JDK internal class jdk.internal.module.Modules. With this change, nashorn uses java.lang.reflect.Layer public API to create single Module layers as needed. And nashorn generates/loads code into appropriate modules (which calls java.lang.reflect.Module.addReads, .addExports public APIs) to add module export/read edges as needed. -Sundar