Use typed memoryviews in rank filter package
Improve code layout and styling