Added a function for executing arbitrary sqlite3 commands

Should be useful for debugging and perhaps as a slightly more dangerous but
powerful feature since we aren't afraid of sql injection.
Nicer formatting for generate_summary