Thanks Carl Meyer and Tim Graham for the reviews and to all involved in the discussion.
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!