Charge separation in mixed-halide MX crystals: novel device applications