Add command processor

This PR introduces the command processor.
Targets #236 and #219.
You can remove this comment, there are no forward declarations here.