Make handling of mongodb config more robust

- Make sure hosts parameter is interpreted correctly
- always allow the use of alias

Change-Id: Ie531788b678fb9635705a1175d3445269dcad6e8