Output cleanup, argument checking

* check for empty ids and update test suite
* cleanup output from command line tool
* make API a bit more consistent