Python 3 compatibility

Replaces msgfmt.py with a version adapted from the one bundled with
Python 3.

Uses compatible print statements in setup.py.