Patients will be assigned to one of 6 strata prior to enrollment; all BRAF assessments used for stratification below must be done at the Lindeman and Ligon Labs at Brigham and Women�s Hospital using the same procedures as described in this protocol; assessments for both BRAF V^600E mutation and BRAF KIAA1549 fusion are required for patients who will enroll on strata 1, 2 and 5 * Stratum 1: patients with non NF-1 associated progressive, recurrent or refractory pilocytic astrocytoma with pre-trial tumor material available and with a BRAF aberration i.e. BRAFV^600E mutation and/or BRAF KIAA1549 fusion as determined by IHC and FISH, respectively; patients with optic pathway glioma are excluded* Stratum 2: patients with non NF-1 associated progressive, recurrent or refractory pilocytic astrocytoma with pre-trial tumor material available and without a BRAF aberration i.e. BRAF^V600E mutation and/or BRAF KIAA1549 fusion as determined by IHC and FISH, respectively; patients with optic pathway glioma are excluded* Stratum 3: patients with neuro-fibromatosis 1 (NF-1) associated progressive, recurrent or refractory low grade glioma (World Health Organization [WHO] grade I & II), with or without tissue* Stratum 4*: patients with non-NF1 associated progressive, recurrent or refractory optic pathway glioma with or without tissue available for BRAF evaluation* Stratum 5: patients with non NF-1 associated progressive, recurrent or refractory low grade glioma other than pilocytic astrocytoma or optic pathway glioma with a documented BRAF aberration identified in pre-trial tumor material* Stratum 6: patients with non-NF-1 associated progressive, recurrent or refractory low grade glioma (other than optic pathway glioma [OPG]) with tissue available for BRAF analyses who cannot be classified into stratum 1, 2 or 5 due to inadequate tissue quality, assay failure, etc**Clarification: Stratum 4 was specifically designed for patients with hypothalamic/optic pathway gliomas; the intent is that if there is any optic chiasm invasion regardless of where the tumor is originating from (chiasm vs. hypothalamus vs. other location), the patient should be enrolled on Stratum 4, regardless of whether the tumor has been biopsied or not; obviously, there are some tumors that include part of the hypothalamus and clearly do NOT include the chiasm at all; in these situations, and if the tumor is a biopsy proven pilocytic astrocytoma, these patients should be enrolled on Stratum 1 or 2 (depending upon BRAF status) Patient must have a histologically verified diagnosis of craniopharyngioma* Stratum 1: patients with progressive unresectable or recurrent craniopharyngiomas treated with surgery alone, who have not received radiation therapy; patients with unresectable craniopharyngiomas, (i.e. residual measurable disease following surgical resection) will be enrolled at the time of progression* Stratum 2: patients with progressive or recurrent craniopharyngiomas following radiation therapy; the patient must be at least 6 months post irradiation to be eligible Stratum A, currently closed to enrollment: Patients must have a recurrent, progressive or refractory DIPG following radiation therapy with or without chemotherapy* Histologic diagnosis is not required for patients with typical imaging findings of DIPG (defined as patients with a diffuse expansile mass centered in and involving at least 2/3 of the pons); patients with brainstem tumors who have undergone biopsy with a diagnosis of high-grade glioma or diffuse infiltrating glioma are also eligible Stratum B: Patients must have a histologically confirmed diagnosis of a non-brainstem high-grade glioma (NB-HGG) that is recurrent, progressive or refractory following therapy which included radiotherapy; spinal primary disease is eligible Stratum D: Patients must have a histologically confirmed diagnosis of ependymoma that is recurrent, progressive or refractory following therapy which included radiotherapy Stratum E: Patients must have a histologically confirmed diagnosis of medulloblastoma that is recurrent, progressive or refractory following therapy which included radiotherapy RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients with progressive DIPG, as defined by progressive neurologic abnormalities or worsening neurologic status not explained by causes unrelated to tumor progression (e.g., anticonvulsant or corticosteroid toxicity wean, electrolyte disturbances, sepsis, hyperglycemia, etc.), OR an increase in the bi-dimensional measurement, taking as a reference the smallest disease measurement recorded since diagnosis, OR the appearance of a new tumor lesion since diagnosis* Please note: patients with a radiographically typical DIPG, defined as a tumor with a pontine epicenter and diffuse involvement of more than 2/3 of the pons, are eligible without histologic confirmation* Patients with pontine lesions that do not meet these radiographic criteria will be eligible if there is histologic confirmation of malignant glioma World Health Organization (WHO) II-IV RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients must have received a minimum of 54 Gy focal irradiation administered over approximately 42 days prior to enrollment; patients must have recovered from the acute treatment-related toxicities (defined as =< grade 1) of all prior chemotherapy, immunotherapy, or radiotherapy prior to entering this study RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients must have had their last fraction of: * Craniospinal irradiation or radiation to >= 50% of pelvis > 3 months prior to enrollment* Focal irradiation to the primary site > 42 days prior to enrollment* Local palliative irradiation other than previously irradiated primary site (small port) >= 14 days RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Absolute neutrophil count >= 1,000/mm^3 RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Platelets >= 100,000/mm^3 (unsupported, defined as no platelet transfusion within 7 days, and recovery from post-transfusion nadir) RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Hemoglobin >= 8 g/dl (may receive transfusions) RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Albumin >= 3 g/dl RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients must be off all colony-forming growth factor(s) for at least 7 days prior to enrollment (i.e. filgrastim, sargramostim or erythropoietin); 14 days must have elapsed if patients received poly(ethylene glycol) (PEG) formulations RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients must agree to avoid grapefruit or grapefruit juice and Seville (sour) oranges during the entire study RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients who have had > 60 Gy total radiation to the pons (e.g. patients who have received re-irradiation) RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have had prior histone deacetylase (HDAC), deacetylase (DAC), heat shock protein 90 (HSP90) inhibitors for the treatment of their DIPG RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have had valproic acid within 28 days prior to enrollment RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have had prior bone marrow transplant RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have significant acute deterioration in neurologic status in 72 hours prior to enrollment, in the opinion of the treating physician RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have any other significant concurrent illness RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients have a history of any other malignancy RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients are known to be refractory to red blood cell or platelet transfusions RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients who are receiving any other anticancer or investigational drug therapy RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients who are required to receive any medication which can prolong the QTc interval RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Female patient is breastfeeding RECURRENT/ PROGRESSIVE DIPG (STRATUM 1): Patients who in the opinion of the investigator are unwilling or unable to return for required follow-up visits or obtain follow-up studies required to assess toxicity to therapy or to adhere to drug administration plan, other study procedures, and study restrictions NON-PROGRESSED DIPG (STRATUM 2): Patients with DIPG who have not yet progressed by clinical or radiographic criteria* Please note: patients with a radiographically typical DIPG, defined as a tumor with a pontine epicenter and diffuse involvement of more than 2/3 of the pons, are eligible without histologic confirmation* Patients with pontine lesions that do not meet these radiographic criteria will be eligible if there is histologic confirmation of malignant glioma World Health Organization (WHO) II-IV NON-PROGRESSED DIPG (STRATUM 2): Patients must have received a minimum of 54 Gy focal irradiation administered over approximately 42 days prior to enrollment; patients must not have received any other prior therapy for treatment of their central nervous system (CNS) malignancy besides standard radiation therapy NON-PROGRESSED DIPG (STRATUM 2): Patients must have recovered from the acute treatment-related toxicities (defined as =< grade 1) of radiotherapy prior to entering this study NON-PROGRESSED DIPG (STRATUM 2): Patients must have had their last fraction of focal irradiation to the primary site > 14 days prior to enrollment; patients must not have received local palliative irradiation or craniospinal irradiation NON-PROGRESSED DIPG (STRATUM 2): Absolute neutrophil count >= 1,000/mm^3 NON-PROGRESSED DIPG (STRATUM 2): Platelets >= 100,000/ mm^3 (unsupported, defined as no platelet transfusion within 7 days, and recovery from post-transfusion nadir) NON-PROGRESSED DIPG (STRATUM 2): Hemoglobin >= 8 g/dl (may receive transfusions) NON-PROGRESSED DIPG (STRATUM 2): ALT(SGPT) =< 3 x institutional upper limit of normal NON-PROGRESSED DIPG (STRATUM 2): Albumin >= 3 g/dl NON-PROGRESSED DIPG (STRATUM 2): Potassium >= LLN NON-PROGRESSED DIPG (STRATUM 2): Patient has no ventricular arrhythmias except for benign premature ventricular contractions NON-PROGRESSED DIPG (STRATUM 2): Patient has a QTc interval < 450 ms NON-PROGRESSED DIPG (STRATUM 2): Patients must be off all colony-forming growth factor(s) for at least 7 days prior to enrollment (i.e. filgrastim, sargramostim or erythropoietin); 14 days must have elapsed if patients received PEG formulations NON-PROGRESSED DIPG (STRATUM 2): Patients must agree to avoid grapefruit or grapefruit juice and Seville (sour) oranges during the entire study NON-PROGRESSED DIPG (STRATUM 2): Patients who have had > 60 Gy total radiation to the pons (e.g. patients who have received re-irradiation NON-PROGRESSED DIPG (STRATUM 2): Patients have significant acute deterioration in neurologic status in 72 hours prior to enrollment, in the opinion of the treating physician NON-PROGRESSED DIPG (STRATUM 2): Patients have diarrhea > CTCAE grade 2 NON-PROGRESSED DIPG (STRATUM 2): Patients have a history of any other malignancy NON-PROGRESSED DIPG (STRATUM 2): Patients are known to be refractory to red blood cell or platelet transfusions NON-PROGRESSED DIPG (STRATUM 2): Patients who are receiving any other anticancer or investigational drug therapy NON-PROGRESSED DIPG (STRATUM 2): Patients who are required to receive any medication which can prolong the QTc interval NON-PROGRESSED DIPG (STRATUM 2): Female patient is breastfeeding NON-PROGRESSED DIPG (STRATUM 2): Patients who in the opinion of the investigator are unwilling or unable to return for required follow-up visits or obtain follow-up studies required to assess toxicity to therapy or to adhere to drug administration plan, other study procedures, and study restrictions