Dyadic Green Functions and their applications in Classical and Quantum Nanophotonics