Cleaned up a lot of comments and docstrings.