(maint) Add tests and fix up dump action

There were a few formatting problems with the dump action. This fixes
those up and adds tests around the dump functionality.