Can you document the threading semantics?  If this is intended only for single threaded use (I haven't gotten far enough into the review to know), please disregard my previous comment about synchronizing `ensureOpen()`.