Pluggable credential manager to support tests

This will also be useful when we need to support more platforms.