Adding Python 3 support to C extension

With bug fix and testing from @derpston.