TestCase for b1191617 and slightly more stable way to execute python in test cases.
Fixed b1191617.
Fixes bug 1191617. Improves testing.

Overtypes triggers, so that text objects are properly killed, also
changes test.py to pass python values using a temp file and :pyfile
instead of typing it out using << EOF.