JC: added stats by time frame to search/stats. Changed the search code as well. search and stats view are generic.