Apply the remaining side-effects at the I/O layer

The aim is to keep the core as functional as possible, and keep
the side-effects separate.

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