Add Python3 compatibility, use distutils and fix compiler issue

These changes add backward-compatible Python3 support (which was just changing print from a statement to a function) and also fixes issue #1.