update mongodb to 1.3.23, refactor some core to lib