Diagram genus, generators and applications. (2018)