Electronic structure and magnetic ordering of the semiconducting chromium trihalides CrCl₃, CrBr₃, and CrI₃