Implemented mongodb persistence.
Fixed enviroment.