Added a serialise function to CTJSON.