Add support for explicitly defined realms, realm wildcarding.

@josh

/cc @kbuckler