Changed: Improved the JSON-RPC code, made things more generic/flexible