move schema into its own file, and add a "Class" prototype for auto-configuration.
remove crappy addSchema.
factor out more of the schema manipulation.