Stream API

This a attempt to create a `Stream` API, and in so doing centralize all uses of `getWrapperForURI()`.  This also continues 6d428836 making `Stream::opendir()` return a `Resource` since the users usually want a smart pointer.