Molecular mobility and protonic conductivity in polymers: hydrogels and ionomers