docs: def loadrc(filename):
      '''
      loadrc(filename) yields the dict object encoded in JSON in the given filename; if the filename
        does not exist or does not contain a valid JSON dict, then an error is raised.
      '''
      filename = os.path.expanduser(os.path.expandvars(filename))
      if not os.path.isfile(filename): raise ValueError('Filename %s does not exist' % filename)
      with open(filename, 'r') as fl:
          dat = json.load(fl)
      try: dat = dict(dat)
      except Exception: raise ValueError('Given file %s does not contain a dictionary' % filename)
      return dat