Implemented dynamic region generation with configuration. Closes #345. Closes #346.