Evolved gas analysis and multistep pyrolysis of polymers