Handle large writes by splitting input

Before, we'd simply drop anything larger than maxWriteLen, which seemed
quite wrong.  I wrote a test to confirm them.  The test failed.  Now the
test succeeds.  Large writes work as expected.