Try to improve format! error messages

Instead of just saying "unterminated format string" and friends, instead print
information about what was expected and what was found.

Closes #9931