Fix another case of #2813 - Quick Edit for JS crashes if invoked on a
toString() call.

Add a unit test for this case too, doing some sizable cleanup to the
findMatchingFunctions() test suite in the process - removed unused code,
centralized duplicated setup/harness code.