Engine tests refactoring. Closes #102 and closes #62