Add support for slow query logging.

Added tests and template for turning on MySQL slow query logging.

I apparently forgot to send a PR last year... :-(