support scoped cache
This commit adds support for scoped cache, e.g. keys can be tagged with a scope, so that the same key can exist in multiple scope and returns the value based on the scope set.
This is practically required for scoping by subnet in ECS, but it doesn't implement ECS completely. This is just a framework to make something like ECS possible in a module.
The scope search is currently non-exhaustive, it either returns a value bound to given scope, or look into global scope, nothing in between.