rewrite MapRevisions handler from sql to python, go back to postgres as we are not restricted to DB engine anymore