Added unit tests for writing, plus template machinery for convenient usage.

Made a start on the infrastructure for rescheduling completions, as boost asio's async read/write come with their own completion handler framework.