Added some convenience functions

Just added a few functions that we found useful where I work, so I assume others might, too. The rest is mostly debugging output.
I think it was just to help me track what was going on, when things weren't doing what I expected.