Characterization of GEM detectors for application in the CMS muon detection system