Persist search form order, fix key error when searching dates and numbers, and some minor cleanup.