Started in https://github.com/aperiosoftware/astropy/pull/48 - this is probably the easiest C code to replace with pure Python.