Split schema into a module; use namedtuple attrs

NOTE: This is all untested.