Diagram Genus, Generators, And Applications