Atomic and Electronic Structure of Defects in hBN: Enhancing Single-Defect Functionalities