Bug fixes + unit test improvements

Known bugs exist. A long way to go on unit tests, but hope to have happy path coverage based on examples/searchcommands_app by day's end.

Signed-off-by: David Noble <dnoble@splunk.com>