python 3 compatibility

Replaces #35 merging into hydro-devel branch only.