Fix python 3 compatibility for v0.4

also replace insidious tabs with spaces
bump version in docs to 0.4