db.mongodb_wrapper: flattening, unflattening documents for mongo as well.
tests db.py: tests still half-assed but now testing put and update directly.