Lithium insertion/deinsertion mechanisms in the transition metal pnictides LixMPn4