The Prime Spectrum And Representation Theory Of Generalized Weyl Algebras, With Applications To Quantized Algebras