Foundations of Quantum Gravity