The Fundamental Groupoid and the Geometry of Monoids