trim down install schema a bit

- install data in tables at once, instead of one statement per row
- remove some comments
Reorder database update handling

first determine where we are, then act on it
move actual db migration to db_updates.php
Replace db migration magic with a switch statement
Move huge switch statement into update function

the detour with the separate function was taken to ensure that
no undesired code changes happened.

Meanwhile schema_install is adapted to look more closely like it creates
a pre-2.0 database. This way we can reuse the updater, reducing the number
of ways a database can come into existence.
provide more debugging output on sql error
Move all of schema_install into db_updates

All schema changes, starting from initial setup, are now done
through db_updates.php
Fix using table prefixes

Both the database initialization and a later update step weren't prefix-aware.