manipulationTestHelper support click manipulations

Depends on #642.
These nested functions enjoy the scope of the functions they are nested in. For example, this `a.expectedResultHtml` is from two functions up the hierarchy.

Rewriting this whole helper isn't worth the effort. It was somewhat readable before I made this change and now it is more readable. We shouldn't invest so much more in the readability of this.