De-drudgeon

Extract all the command-line stuff into a [common lib](https://github.com/LeanKit-Labs/drudgeon) so that other things can make use of it.