It is not middleware, so move it up one level. It was also use from core/ showing that indeed its use is not limited to middlewares.
Define locations for keys and secondary zones, 'n stuff. Add a bunch of tests as well.