revert the changes of 56ceab6 for main_unittest.cc
add streaming mmd, refactor linear time mmd