Fix for HTML output.

Also now outputs debugging information for HTML output.
Add queryRowsIntoOutput database method
Update the database to version 2

This renames some of the columns so they are more unique. Moves appeals
into a separate table. Moves ranks into a separate table.