Initial commit. Refactored the common mongoose code into this adapter.