More work on MongoDB rework...

There is a lot changing in this branch and few things which will be being removed. A few functions here and few added elsewhere.

Once the majority of the work is done I will document the differences between this version and 0.5.