Add optional / and enforce end-of-line to URLs

Previously, we didn't enforce the end-of-line in our URL regexps.
We did this so that URLs wouldn't have the ugly backslash character
when looked up from code. But, this meant that a user could go
to /loginlololol and it would match the login URL.

Now, we match the end-of-line, but add an optional slash to support
those (admittedly valid) URLs. The good news is that the reverse
lookup omits them!