Update index.js to use mongolab

- Code refactor
- Change MongoDB from local to mongoLab
- Use secrets file for handling mongolab authentication