Ability to store configuration in MongoDB, also fixed a flags bug