The Anzellotti-Gauss-Green Formula and Least Gradient Functions in Metric Measure Spaces