Sort and search functions

Fully functional sort, partially functional search