Incremental commit: functorise the read/write test

Signed-off-by: David Scott <dave.scott@citrix.com>