Pressure-induced transitions in FePS$_3$: Structural, magnetic and electronic properties