REF: Refactored Cython code into separate modules.