Hq dropdowns

Implements https://docs.google.com/a/dimagi.com/document/d/1GtVw-_Wq7aRyFCY0ervt6Q8nQNsJde5R_zZXFXAfr-Q/edit?disco=AAAAAQ_ZnoE

More than half of the commits are about performance though. The main navigational-menu loading time increases by ~0.140 seconds from around 0.09 seconds to 0.23 seconds. 

@czue @snopoke - the number of calls to various db-level queries (Domain.get_by_name) is reduced to 2 from around 37. 
>Why do you need to check `or not self.domain`?

So that if `self.domain` is `None` return whatever `project` (which would be `None`) was passed. That avoids checking for `None` before passing to `Domain.get_by_name`

Regarding the second point, I implemented that way at first and changed thinking that it reduced the number of calls to `Domain.get_by_name`. Will fix that.