refactoring: Provide our own implementation of a resource.

This used to use a StringIO instance in case Rope was unavailable,
but that did not provide all the interface we needed. Implement our
own version so we can easily provide all APIs as needed.

Fixes #54