Turning data serialisation into a class of its own.