Structure, isomerization, and ionization of N2O4 on liquid water, ice, and silica surfaces