Implement and test simple cases of line.formatText

Removes need for some Utils functions and tests
add more complex line.formatText() tests and fixes
remove dead code

we are the only consumers of line functions
add tests for document contructor
add document manipulation tests