MongoDB integrated, main changes to the core and fix some bugs