A perfect imperfection: Quantum magnetometry and applications using nitrogen-vacancy defects in diamond