URL rewrite middleware for koa using a rule map, based on koa-rewrite.