A big old refactoring with loads of new tests. API has been greatly simplified to remove knowledge of the protocol from the I/O adapter.