Memoize parsed html

This might be better than #1843 but it has other test failures. Would like a spot/sanity-check from @lmorchard, @jezdez, and/or @ubernostrum