Add basic test suite for credentials abstraction.

TODO: Error cases (IO errors and bad data upon retrieval).