Merge the three memory-management functions into one.
Split the Keystone response parsing into separate functions. Pull more Swift functionality up into swift_request common function.