Remove most uses of the global $CONFIG variable