Beginning of a base class all APIs will inherit.

Also rewrote some of the Unity code to make more sense...