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 suspect that we might not be making very sophisticated use of scopes, but I just needed to check that the QCF didn't already exist, as I was writing a script to create the ones our application needs.