updates to docs, other small refactors
patches to run under python 2 or 3
add some more tests for better coverage. Fixes #3