generic setup for searching

A more convenient way of searching, with a new search class. 

Also added paging & some other small changes