vte.sh: Improve vte.sh script and add testcase

Improved vte.sh script by Peter De Wachter.

Add a test that checks the urlencoding is done right.