Heteroepitaxy, polymorphism, and faulting in GaN thin films on silicon and sapphire substrates