Encode and decode between JSON and UIBezierPath objects, following the API conventions of Foundation's NSJSONSerialization class