Refactored BPMN engine. Still needs some changes to existing commands
and API.