Encode result of safeApplyKey() as JSON string

As of 35.0a1 build 2014-10-04, the Array return value of safeApplyKey() is treated as a privileged object rather than a simple Array.

Fixes #99.