Add debugInfo to a few classes that cause recursion

These objects often hold complicated cyclic references. This causes
something like debug($controller) to go horribly wrong. This removes the
most annoying cyclic references.
Fix issue where __debugInfo() would be called with 0 depth.

When the remaining depth is 0, no properties should be extracted and
exported.
Merge pull request #3675 from markstory/3.0-more-debug-methods

3.0 Add __debugInfo to a few classes that cause recursion