From Azo-Linked Polymers to Microporous Heteroatom-Doped Carbons: Tailored Chemical and Textural Properties for Gas Separation.