First attempt to cythonize the aonlm algorithm.