[865758] Added a database healthcheck middleware by refactoring the Mongoose handler and the user model, and modifying the architecture slightly to allow this new approach