Document paragraph wrapper better.

Change-Id: Idfc97d0537c694373d18a9058c884f56ecd25168
(Bug 71361) Leave link tags out of p-wrappers wherever possible.

* Some fixes to closeOpenPTag code.
* Added a new wt2html test (which passes).
* Previously failing wt2html and html2html tests now pass.
* The following snippet still wraps the A1 link tag in a <p>
  because the p-wrapper flushes the token buffer in some
  scenarios. Will investigate later since that is a more
  invasive fix.

a [[Category:A1]]
[[Category:A2]] [[Category:A3]]
[[Category:A4]]

Change-Id: Ibf17d725b9c78d57f20f624618e241612b3f332c