Reproduced the work done in the cython_codegen branch (which was very
out of date)