Added threading to updated database queries.
Pulled database fixes.
Merged in more database fixes.
More database fixes.