Allow salt cloud to start maintaining its own cachedir

These functions will allow salt cloud to start keeping track of minion state. It is not currently being used in any cloud providers, but that will change soon enough. I am submitting it now because it includes a change that @thatch45 thought he could make use of elsewhere.