Updated sphinx docs and refactored to remove circular imports.
Updated documentation, added some argument type checking, and refactored to remove circular imports.