Synthesis and characterization of heat resistant, pyridine-based polyimides with preformed ether and ester groups