Applications of molecular dynamics to the study of thermal degradation in aromatic polymers. I: Polystyrene