Finished search and relevance based sort

Untested as of now, so commented out the new code and left the old. will
test when we have contact cards.