Cython support

This isn't ready to merge yet, but since it's getting there I thought it would be useful to change to a pull request. Fixes #27.