cli options and tests

@nevir