Add schemas code

Can we move all the defined topes, syntaxes, etc into a separate file away from the logic so it is easy to see and extend the semantic types this program understands.