Fixes in scripting to support packages and closures

Fixes script class name generation and registration, removes classloader disposal.