Added support for optional parameters

Also fixed a bug that triggered when requests matched rules on a pipeline and
then failed in another handler.
Refactored optional path handling

Now optional path parts can be specified using the 'optional' parameter of the
builtin 'path' parser.

Also improved the api a bit so route registrations can be chained.
Updated package.json and added support for PATCH