manipulationTestHelper support click manipulations

Depends on #642.
The reason for the `/* jshint latedef: nofunc */` instead of `true` is that functions are in the code below where they are called.

For example, this one, `manipulateAndAssert`, is right below where it is called.

In JavaScript this works because of hoisting. Should be fine as long as one is careful.