Allow writing a container multiple times.

@caridy @tbranyen 

What do you think of this approach to allowing multiple write calls? It's effectively making it more explicit that the contained modules are not re-usable once the conversion has happened. We still only format/build the result once, but we now cache the result and re-use it on subsequent calls to #write.

Closes #155.