Refactored query to be using the new task system instead.
Removing the passing of region around for all functions!