#1039 PLCgen: Allow state variables to be stored in a global variable list.
- Creates a global variable table for state variables
- Adds a toggle for targets to decide where to put the state variables.
- S7 is not modified.
- Other targets use main program storage only if all code is in the main program, else they use the new global variable list.
Closes #1039 (closed)