Remove outdated util script.

It wasn't really useful anymore and still uses sqlite3-specific stuff.
Subexpressions must be named.
Column names are effectively converted to lower case.
Fix argument formatting.
Equality operator is single =, not double.
Port analysis database opening.