Switch to a ServletContextListener to manage MongoDB Connections.