Change how the input from rusti is formatted to allow duplicate definitions

Closes #5675, #6617, and #6772

This changes each recorded declaration/stmt to be in its own block to allow for duplicate names. It also fixes #6617 while I was at it by changing the generic `print` to `pp`