Incorporating deep electron traps into perovskite devices: towards high efficiency solar cells and fast photodetectors