Remove unnecessary parenthesis
Improve determination of linebreaking nodes
Improve ranges.contract() and ranges.expand() around linebreaking nodes