I just ordered a kit yesterday and started to get acquainted to the upcoming work by trying to prepare one of my current PCBs in the software "dry dock".
As a full-time IT Pro using C# since 2008 and selling a productive CRM solution based on > 500.000 lines of C# code, I of course had to put together the necessary VS 2010/13 libraries and start analyzing the source code in the VS Debug IDE.
I plugged in my web cam and voilá it started to work.

(BTW: my due respect to Juha, your code is very well written and easy to understand.)
I use Eagle 5.6 and there are several ways to create a centroid file but I found none that creates a 5 column CSV.
The most common suggestion I found is to use the mountsmd.ulp (a .ulp file is a User Language Program script file you can execute on your current PCB board and or schematic) which comes quite close the the expected CSV file format. It doesn't have commas but spaces between the values. I also have to check whether the dimensions are in mm or mil.
The output files the ULP produces only contain the PCBs SMD components with two separate files for top and bottom layer. I suggest to build the input on this unmodified output instead of creating a new .ulp.
The newer eagle versions (Version 7 by now, but expensive to upgrade from 5.6

Maybe one of the other Eagle users has V6 or 7 and can confirm this?
I will create the necessary reader part myself because I don't want to wait for Juha to implement it. He probably has enough other tasks on his agenda

@juha: I will forward you the modified source when I am finished so you can integrate and check the modifications. Is that OK with you?