Nashorn-based AMD modules loader in Scala