Rework typeclass of types.
Update term structure to match new type library.
Add schema instantiation.
Add Apply instance for TmIn and some testing functions.