For anyone who finds this later, I put together a small package (registration pending) implementing this algorithm here: