JSON-RPC functions now take a Document as input and return nothing, so as to avoid potential issues with allocation.