Moved global variable gCog nto the globals infrastructure.