Changed handler format to conform to Node.js norms.
Changed handler format to conform to Node.js norms.

Callbacks should always take an "err" argument first for asynchronous
error handling.

Callbacks should be passed in as the last parameter (this was already
the case).

The parameter array should be passed in as an array. -- Now, I had
quite some internal debate about this. It is nicer syntax-wise to have
the arguments come in as actual arguments, not as an array.

However, it does have the effect that the callback parameter moves
around depending on user-submitted data. So the function will have to
handle finding out which parameter is the callback, which is a lot
uglier and more error-prone than just passing in the arguments as an
array.

Finally, I've added an additional parameter "opt" which contains the
HTTP request object and the server object. This is useful as an
extensible way to deliver more features and options to the handler in
future versions of the library.

Here is an example handler with the new syntax:

server.expose('multiply', function (args, opt, callback) {
  var a = args[0],
      b = args[1];

  callback(null, a*b);
});

justmoon/node-jsonrpc2,wision/node-jsonrpc2