Engine class and tests