Implements type checks, and moves runtime class to runtime.ts.
Reorder includes.
Add all methods to the global scope for invoke special.