Test use mock mongodb

changes a lot, to make test without mongodb instance, please verify carefully.

@fuqcool