Added refresh to the metadata credentials.

This also heavily restructures the module itself, which enables
adding/removing credentials without altering module-level scope.
Fixed remaining tests plus some cleanup.
Added ``CredentialResolver`` tests.
Integrated initial feedback.
Incorporated initial feedback.
More feedback applied to credentials.
Fixed tests for Python 2.6.
Merge branch 'refresh-credentials' into develop

Fixes #251.