Phase Transitions and Water Splitting Applications of 2D Transition Metal Dichalcogenides and Metal Phosphorous Trichalcogenides