More housecleaning

Moved most caching to a function
Yet more housecleaning

Updated bill search form