Adapt code to work with the feature/refcounted branch of readium-sdk.