Nucleotide-resolution bacterial pan-genomics with reference graphs