Lead off with main().
Extract common txp_prefs lookup code.
Test that our example Source isa-Textpattern.