Pass a function to define regions with RegionManager#addRegions

Implements #1371.
we should apply this with the args from the addRegions method, just to make it a bit more inline with the rest of the codebase.