Add support for explicitly defined realms, realm wildcarding.
Merge remote-tracking branch 'kbuckler/master'