Moved helper functions to dbmisc and stringhelp. Rewrote search functions to support more customization of searches, such as sorting of results, and to unify the results_page_search and api_search functions into one.