testing/server: add method for registering custom handlers for paths

Related to #105 and #113.