Improve design of ScriptApi inheritance hierarchy