Add checks for empty text nodes in OperationTests

Empty text nodes should never be left behind by an operation. Adding
these extra checks have caused some operations to fail.
Stop whitespace upgrade logic from creating empty text nodes
Merge pull request #430 from peitschie/empty-text-nodes

Reduce the number of places that create empty text nodes