Branch /trunk r144 to /branches/sql-cleanup to go over the SQL with a fine-tooth comb. This will include preparing to rearrange the database tables (quite) a bit.