Move cmd_input global data into an allocated data structure. (dm)