Improve test.html permalinks

Summary:
permalinks were annoying because they could still include parens,
which made them unusable as link targets in markdown.

This diff escapes parens in permalinks, so that we can happily
embed them in our markdown.

Test Plan:
pressed `permalink` (from the default test.html question, which
includes images and uses parens for them), and made the following
link in phabricator:
[test](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22This%20is%20a%20rectangle.%20%20%20%5Cn%21%5B%5D%28https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%29%5Cn%5CnLet%27s%20measure%20the%20%24%5C%5Cgreen%7B%5C%5Ctext%7Bgreen%20line%7D%7D%24%20below%20using%20both%20rectangles%20and%20a%20centimeter%20ruler%3A%5Cn%5Cn%21%5B%5D%28https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%29%5Cn%5Cn%2A%2AThe%20line%20is%20%5B%5B%E2%98%83%20input-number%201%5D%5D%20rectangle%28s%29%20long.%20%2A%2A%20%20%5Cn%20%20%5Cn%2A%2AThe%20line%20is%20%5B%5B%E2%98%83%20input-number%202%5D%5D%20centimeters%20long.%2A%2A%20%20%20%20%5Cn%5Cn%2A%2AThe%20length%20of%20each%20rectangle%20is%20%5B%5B%E2%98%83%20dropdown%201%5D%5D%20than%20a%20centimeter.%2A%2A%5Cn%5Cn%2A%2ASo%2C%20it%20takes%20%5B%5B%E2%98%83%20dropdown%202%5D%5D%20rectangles%20than%20centimeters%20to%20measure%20the%20line.%2A%2A%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%22%3A%7B%22width%22%3A400%2C%22height%22%3A70%7D%2C%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%22%3A%7B%22width%22%3A425%2C%22height%22%3A150%7D%7D%2C%22widgets%22%3A%7B%22input-number%201%22%3A%7B%22type%22%3A%22input-number%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22value%22%3A1%2C%22simplify%22%3A%22required%22%2C%22size%22%3A%22small%22%2C%22inexact%22%3Afalse%2C%22maxError%22%3A0.1%2C%22answerType%22%3A%22number%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22input-number%202%22%3A%7B%22type%22%3A%22input-number%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22value%22%3A2%2C%22simplify%22%3A%22required%22%2C%22size%22%3A%22small%22%2C%22inexact%22%3Afalse%2C%22maxError%22%3A0.1%2C%22answerType%22%3A%22number%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22dropdown%201%22%3A%7B%22type%22%3A%22dropdown%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22choices%22%3A%5B%7B%22content%22%3A%22shorter%22%2C%22correct%22%3Afalse%7D%2C%7B%22content%22%3A%22longer%22%2C%22correct%22%3Atrue%7D%5D%2C%22placeholder%22%3A%22%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22dropdown%202%22%3A%7B%22type%22%3A%22dropdown%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22choices%22%3A%5B%7B%22content%22%3A%22fewer%22%2C%22correct%22%3Atrue%7D%2C%7B%22content%22%3A%22more%22%2C%22correct%22%3Afalse%7D%5D%2C%22placeholder%22%3A%22%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22Fill%20in%20the%20blanks%20and%20select%20the%20correct%20answers.%20%20%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%7B%22content%22%3A%22The%20line%20is%20%24%5C%5Cred1%24%20rectangle%20long.%20%20%5CnThe%20line%20is%20%24%5C%5Cblue2%24%20centimeters%20long.%5Cn%20%20%20%5Cn%2A%2AThe%20length%20of%20each%20rectangle%20is%20%2Alonger%2A%20than%20a%20centimeter.%2A%2A%5Cn%5Cn%2A%2ASo%2C%20it%20takes%20%2Afewer%2A%20rectangles%20than%20centimeters%20to%20measure%20the%20line.%2A%2A%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%5D%7D)

I also tried this using a permalink from http://khan.github.io/perseus ,
and it didn't work (which I won't replicate here because the output is
ugly).

Auditors: charlie