Crosslinking and carbonization processes in PAN films and nanofibers