Determining the correct position for the ex-global variable declarations is complicated by the potential generation of additional includes due to refactoring.
Need to revisit the reasoning behind new/additional includes as we now use modules rather than includes.