Revise version query system

In order to avoid having a dirty working directory on the
live web server, this commit moves index.php to index.php.template.txt
and generates index.php in update-version-query-strings. The index.php
file is not under version control.