Adds a command processing interface

Other minor fixes