def get_tagstring(refid, tags):
    """Creates a string from a reference ID and a sequence of tags, for use in report filenames."""
    return "_".join([refid] + [t[0] + "." + (t[1] if t[1] else "None") for t in tags])