Use DBI quote() abstraction to handle special chars

This supports SQL backends that don't follow the standard practice for
escaping single quotes.
Wrap die calls in a failure() sub for improved code and message control

Now supports a --quiet option to surpress error messages, and
--fatal-failure always returns 1 in all failure modes.