Move Rrd to a separate file. Cleand up some more of the lua code. Still things to do.