Implement the debugstatus package.

Abstract out some helper functions to be used in the charm store and similar services.

(Review request: http://reviews.vapour.ws/r/628/)
Well, all the more reason for a comment then :)
We should hint at how it's intended to be used.