refactored ranking and fixed some tests; ranker reimplemented in cython (70% done)