WIP - just wanted to get this commit out. Changes related to numpy/scipy and also cython. Also, changes and tweaks to algos.