Python 2/3 compatibility module

Fixes #203