(PE-2650) add add-context-handler function

This commit adds the add-context-handler function which is used
by trapperkeeper-ruby to register rack based ruby applications
with the webserver service.
The implementation of that function is basically three lines of code,
which were previously performed by implementations of all the other
add-*-handler functions, so now they just call the new function
instead of those three lines to avoid duplication of code.