fixed memory leak that was in the TFUtils render state switches, moved those to TFCore