Minor white-space tweaks for consistent brace style.
Restructure depth-first search to more clearly document what *exactly*
each part is checking for.
Several other code clean-ups.

Biggest change is to refactor three matching patterns into a single
big pattern.  Also changed many errs() output messages into dbgs()
messages, since they really are used for debugging, not to report
errors to the user.