Generalizations of the Gap Principle and the Thue-Siegel Principle, with Applications to Diophantine Equations