Fixed a number of things: simplified a bit in _generate_schema function, and moved to python3 printing, among a few other aesthetic things.