change dbconfigs API to accept specific credentials

1. Add a DBConfigFlag bitmask param to RegisterFlags and
   Init methods
2. Add a return value for RegisterFlags method to indicate
   registered DBConfigFlag
3. Add dbconfigs test
Merge pull request #234 from yaoshengzhe/fix_dbconfig_api_with_bitmask

change dbconfigs API to accept specific credentials