Added support for 3D arrays
Refactored Cython stuff with easier code readability in mind
Cython minor fixes