Moved all functions into Cython.  Also, made elements in normal scalars instead of as arrays