Optimize ..-of-a-kind functions a bit

Since rank-hand has to calculate frequencies anyway, just pass that into
the ...of-a-kind functions instead of having to recalculate it.
Remove documentation stub
Clean up comments
Update docs