Finalized the scripting API

Polished scripting APIs and finished the unified API!
It is not compilable yet, but the framework is complete!