Attached is a test version with Asbjorn / Feynor's latest changes for replace_br_with_p.
And thanks for tackling this whole feature, I really didn't want to.
UPDATE -- replaced with slightly newer version.
UPDATE Nov 16, 2013 -- Remove obsolete beta versions