clean engine API and add optional module dumping
Introduce gflags for engine config