Pass a function to define regions with RegionManager#addRegions

Implements #1371.
oh well you're currently passing `barRegion` an `el`. Although generally individual cases should be in separate tests.