Bug 51219: Don't require a newline when round-tripping existing tables

Check if the table or the following node is modified, and only require a
newline if that is the case. This means that modified or new text content will
no longer trigger a newline, but a new paragraph will. This still won't make a
difference in practice for the default serialization of new text content as
the VE will normally return new text wrapped in paragraphs or other elements.
In any case, serializing text on the same line as a table end tag is safe as
the block-level table tag will suppress paragraph wrapping in the PHP parser.

Also added two Parsoid-only test cases both for round-tripping and new content
serialization behavior.

Change-Id: I1342601ceedd28d1002f40463e3160ed6714d792
Merge "Bug 51219: Don't require a newline when round-tripping existing tables"