Dual redox-active porous polyimides as high performance and versatile electrode material for next-generation batteries