Factor out the MySQL connection and update README accordingly.