Move command line handling into a module