Update docs; add proper docstrings to functions exposed to Python.