Improve docs and fix pyflakes warnings
Merge pull request #1 from jni/add-docs

Improve docs and fix pyflakes warnings (verified changes in regression)