BATCH_CONFIG and CONTEXT_CONFIG should not be global variables
The BATCH_CONFIG and CONTEXT_CONFIG structures (objects) are currently global variables but should not be. Instead these structures should be in the workspace and passed to each function that uses them.