Sweeping stylistic changes to diagram.h, but no functionality change. Also removed the strange ones that weren't in gui.