Remove trailing spaces.
Fix JSON array compact printing.

Fixes bug 7180.

As drive-by fixes, actually test the pretty printer and don't ever
start a new line after a property name.