Add standard nodes callback signature for request handlers

You can now provide a callback in your request handler instead of returning the request content directly from the function. Much more aligned with nodeJS typical async syntax and enables us to use promises and other asynchronous constructs for complex request processing.

If callback is undefined, the return value approach will be used.
Improve optional parameter support

Change both checks between actual and expected tokens. The number of tokens may vary when optional tokens are added to a URL. We must not fail if we have less tokens than expected.