First stab at improving whitespace handling.

More of a review request than a pull request. See my additional comments below the diffs.

These rules are helping in my case but still leave something to be desired. Unclear about the possibility of accessing rendered content of a previous sibling if statement, for eg.