BWS reference impl: Clear [[buffer]] on [[error]]
BWS.write: Create promise only when necessary

promise created in the step 1 is used only when [[state]] is writable or waiting.
Move it into each case block.

Reference implementation is untouched since we're extracting handlers and making
it consistent with the spec algorithm just seems to make the code dirty.
BWS: Initialize [[closedPromise]]
Reorganize the read() algorithm

- Less indentation
- The same ordering and handle-error-first as cancel(reason)
Make operation order consistent where possible.

This makes it easier to
- factor out common code
- see and ensure consistency between variables
Make `wait()` return a resolved promise when a BRS is closed.

Fixes #80. Adds a few illustrative test cases showing how this was actually a pretty bad bug, as all the example code was written assuming a resolved promise whereas the spec mandated a rejected one. (Note that the `getNext` example was messed up anyway due to lack of EOF signifier; this commit rewrites it.)
Tidy up tests a bit.

`t.plan` obviates the need for `t.end`.
Cancellation should behave more like closing.

Fixes #90. In particular, the promise returned by `wait()` should be resolved with `undefined`, not rejected with the cancellation reason.

At this point the `reason` parameter is no longer used, which makes sense: it represents a kind of error, but we have moved away from thinking of cancel (formerly abort) as an error condition.
hoge