Add unit tests, demonstrating how to stub out deps.

Physikerwelt asked for some guidance on how to write good unit tests for
classes that depend on external resources. I wrote a few to serve as examples
for additional tests. Because they have an ulterior didactic purpose, the
comments are a bit more verbose than I would otherwise like, but despite that
the tests are good enough to merit being merged.

Change-Id: Ifa97eec1a68fb68b4744d1e5b192b410afe5ef68