Merge implemementation of mongodb branch to master

This pull request adds basic support for storing data in MongoDB.