Optical and electronic properties of defects and dopants in oxide semiconductors