pull get_cl_args() and restart() out of main so it can easily be called as a module; they are now under name == main