Split functionality into subcommands

Fixes #17