implement command line options

This patch implements both long command line options, such as "--key"
and "--key value", and options read from a config file as key=value.