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