Some utility functions.

I think this might be cleaner:

    def safe_makedirs(path):
        if not path:
            return
        if not os.path.exists(path):
            os.makedirs(path)