I have attached here my work so far. I'm not sure if I did the install file correctly. I don't think so as I couldn't yet make the module work. Many parts do seem to work, but it is not gathering data yet.
I will look at it more, but maybe you know better than me if everything looks solid. I'm attaching it as a zip here, but I can attach patches if you prefer.
What do you think so far?