Fixed search form builder having issues with old session.

If an invalid query id somehow ended up in the session, search form builder would die.
Added priority system for filter types
Order search is done, and hopefully search forms are sorta stable now
Merge branch 'develop-nigel' into develop
query_spec has a random failure; decided to tag it as such