Fix an issue with text {} and idnames
Update the tests to make output easier to read, and add in a document test