Add metadata cache

 * Add metadata cache. It caches the list of databases and a list of
   available formats for each database. Database entries are not cached.
 * charset=utf-8 in CGI header.
Improvement of parameter checks and error output

 * Improvement of parameter checks
 * To avoid potential XSS in old MSIE which ignores content-type,
   always do CGI.escapeHTML for parameters in error messages