Implement command pattern

To thin out the engine class and make it more testable, this implements
the command pattern to seperate out the actions for each command into a
dedicated command object.