Translate Model class' storage to C++.

Also:
* Add missing includes to some xsps.
* Generate ::Ref classes programatically.
* Add separate __REGISTER_CLASS macro
    (for use where forward declaration won't work, i.e. typedefs)