Add subcommands to cli

Also fixed failing tests