Use NSKeyedArchiver instead of NSJSONSerialization

NSCoding is the standard serialization protocol in iOS and OS X, so this gives
users more freedom about the types of message objects that can be passed.