R and D for the upgrade of the CMS muon system