tortoise: refactored the engine a bit so that it has real turtles. some additonal minor code and test code refactorings.