Adsorption and diffusion of hydrogen and methane in 2D covalent organic frameworks