Changed realm plugins to use factories (similar to cred-checkers).

Updated the sample and all the machinery that goes with having a command-line
configurable realm.
Updated README.