add support for subcommands, add tests for empty and simple command apps, move stuff around