Add test cases for Javascript string completion

Includes two bugfixes.

I still need to figure out how to test whether the completion session was dismissed.