refactor to avoid mongodb loading at startup (fixes bug in install/metrique-setup-server