Add docstrings for most public API methods.
Add better initialization logic.