cleanup/improve region_t template
big refactoring, window_t act more as cache
a new hudge refactoring