Pass a function to define regions with RegionManager#addRegions

Implements #1371.
@thejameskyle Any reason why?