This patch no longer applied but had a fairly trivial conflict so I've attacheda rebased v3 addressing the conflict in the hopes of getting this further.
--Daniel Gustafsson