Rewrite script classes to use metatables instead of closures.