large update from personal svn

* added sphinx documentation
* added unit tests
* added docstring documentation
* various refactor and renames