Refactor search internals, add sort option for search:results widget

:cyclone: