Fix all issues with Kelp and add MongoDB tests

All issues with Kelp are fixed and MongoDB tests are added.
In case of conflicts while merging, please let this PR take priority.