Use PyCapsule for py3.1, fixes #237

Fixes #237