Effects of intrinsic defects and extrinsic doping on the electronic and photocatalytic properties of Ta3N5