core: improved javascript mode class init and subclasses.