Add docstrings to every function. And a few other comments.
Fix param docstring format to be more Sphinx-y