Implement wfGlobalCacheKey() for database-agnostic keys
Some code paths abuse wfForeignMemcKey() for this purpose. This is semantically
incorrect and seems fragile. Also the empty second argument (for db-prefix) is
either misused or akwardly set to the empty string.
It also creates a namespace conflict between arbitrary application keys (from
the software) and any database names (from users). This commit reduces the
conflict surface down to a single key (namely, "global").
Also added unit tests to assert the implicit restrictions and
assumptions between these cache key functions are valid.
Change-Id: Ia0953b51005fe3de3b881dd1bd64c9d3c85e8c66