Add fleshed-out BaseWritableStream.

This pioneers a "closing" state, which readable streams need (#23). It uses a new technique of more internal states than external ones, but I think this may be a mistake, and will try reversing that in the next commit.
Better BaseWritableStream formulation.

Same idea, but no internal vs. external states, and along the way a decent few bugs got fixed, I think.