python3 compatibility
distribution stuff
added simple tests (thanks @koterpillar)