Migrate from swig to Cython for wrapping and include Python 3 compatibility

On Python 3 tests are still failing, mostly (entirely?) because `mx` isn't available on Python 3.  This PR is not intended to be merged immediately.