Move CLI code from the binary to its own module