Give each type of warning message an id, and move the associated strings to a separate file.

The testing code uses a special safeFormat function which ensures that the referenced string actually exists.