Globally change np to cnp if cimported

Now all cython source files follow our own development guide which recommends to use cnp rather than np.

I also made a few other fixes and stylistic improvements I came across.