[Reviewer: Alex] HSS synchronization

Alex,

Please can you review my enhancements to enable HSS synchronization?

Highlights are
*   I've added some methods to `db.py` (and exposed them through `cache.py`) to
    *   query public IDs associated with a private ID
    *   bulk update IMS service profiles
    *   bulk delete public and private IDs
*  new handling of received requests in gateway.py, covering both
    *    Push-Profile - meaning update IMS service profiles and possibly digests
    *    Registration-Termination - meaning terminate registrations (although all we do at present is flush the cache)
*   new HSSBackend.Callbacks class to encapsulate the corresponding cache interactions
*   moving to register with the HSS using our public hostname and our homestead hostname - this improves homestead failover behavior (but isn't perfect due to restrictions on realm-based routing in OpenIMSCore's HSS).

I've live-tested using OpenIMSCore's HSS, covering causing it to send the messages and us handling them correctly, including checking the database is updated, the logs are correct and the on-the-wire flows looking sensible.  There's still an odd behavior where sometimes OpenIMSCore doesn't respond to Multimedia-Auth requests - I think this is an existing issue (and it seems pretty intermittent) but I'm still investigating.

Matt