Includes a test case useful for some of the previous commits (notes in abstract, PI escaping, counter warnings). Still missing: marginal and side notes. Shouldn't they be ported to InsetMarginal?