Effect of functional groups on microporous polymer based resistance switching memory devices.