Allow engines to live in lib/. Also cleaned up and reduced some unneeded complexity.