Functor experiments.

Signed-off-by: John Else <john.else@citrix.com>
Add comments.

Signed-off-by: John Else <john.else@citrix.com>
More functorisation.

Signed-off-by: John Else <john.else@citrix.com>