Preparation and characterization of poly(ether imide) nanocomposites and nanocomposite foams