Take a look at changesets 51da5cdb8dde and 99be9612028c, and
this discussion. They are not included in the current codebase, as I wasn't happy with the increased code complexity; to get started, you can just compile ML from the second changeset.
I suggest moving them to a new module (dark.mo? other name?), and maybe have it average the dark frames as well, see
EekoAddRawPath. From the silent picture module, you will need the "basic" full-res capture functionality, but outside LiveView.
One issue to solve: the captured area from a ML DNG doesn't match the CR2 exactly (for some reason, Canon code crops a few pixels from the raw buffer before saving it). This will have to be adjusted for every single camera model. Besides, as this one is not a widely used feature, you can't rely on bug reports, so you'll also have to come up with some testing procedure (ideally automated).
As I'm not really into astrophotography, are you (or anyone else) willing to step up and polish the above patches?