Rewrite mongodb plugin to be more sane, adapt termdates usage of mongodb