[enh] moar tests
[enh] code formatting ++ py3 compatibility
[fix] py3 compatibility