Create engine.cpp

The main source file: search function and so on.