COSMIT shut up the build by calling np.import_array in Cython modules

$(make in 2>&1 | wc -l) down from 706 to 517.

Took the liberty of modernizing some of the Cython code while I was at it.
Merge pull request #1556 from larsmans/cython-cleanup

MRG clean up Cython and C code