Add verbose logging option and a debug method to use it.

Closes #609