Fix all instances of W605 (invalid escape sequence)
This MR fixes all instances of W605 (invalid escape sequence) and configures setup.cfg to not ignore those any more; these are real deprecations that will eventually lead to SyntaxErrors, see https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior.
This changes the handling of some strings, and I've tried to be careful not to break the latex formatting where escaped backslashes are already present, but someone should review this carefully.