Elements of Quantum Defect Theory