move engine to lib directory