Documentation

Initial documentation, build using Sphinx (along with some code changes)