Refactor main engine file and add pending tests for it
Delete unused tests
Merge commit '5f534d4'