The old g-code exporter really needed a rewrite for many reasons. The core of the effort is our toolpath calculation code (in the millpath plugin) which in turn heavily depends on the polygon offset code. Calculating polygon offset in a way that no self-intersecting polygons are created is rather hard. Most of the day went into debugging the numerous corner cases of that code.
Note: the polygon offseting code can be used in other contexts as well.