Superconducting nanowire single-photon detectors: physics and applications