Serialize Spiralcraft types to and from JSON representation