initial version of mongo repositories

well, this is quite a mess, and there is a lot of cleanup to do. but
fuck that, it works. i can clean up on christmas