Added support for flags.
Rewrote the configuration processor.