Add schemas code, second attempt.

smaller isn't always clear, this is code is still in development, and it's confusing enough already.