Made Mongo integration better and fixed tests