Workaround for Firefox failing on RemoveText_CopesWithEmptyTextNodes

and some clean-up
Is there a problem with getElementById? It's used all over WebODF.