Origins and mechanisms of hysteresis in organometal halide perovskites