- modernize Tcl (use byte-compiled comparisons, don't use numeric comparisons for string expressions, brace expressions)
- remove deprecated calls (ad_verify_and_get_user_id)
- improve page contracts (use right type for IDs)
- modernize SQL (dollar quoting, named arguments, fix and complete function_args)