Added formatter to serialise enums correctly

Fixes #8