Refactor bits of advanced search

Also adds missing objects (Audits, Workflows and Sections)
More whitespace fixes
Merge pull request #1684 from reciprocity/feature/advanced-search-refactor

Refactor bits of advanced search