Sped up sorting of columns
More cython optimizations and tricks