Make handling of mongodb config more robust

- Make sure hosts parameter is interpreted correctly
- Enable option to always specify an alias
Merge pull request #664 from hdeheer/patch-1

Make handling of mongodb config more robust