added option parser, unit tests, and better handling of response key/value mapping