Improved import support

This patch upgrades the importer to include the new tables for 1.8.1 and 1.9 and reformats the JSON file to be more human readable and less connected to the MySQL table format and indexes.

**NOTE**: This patch slightly changes the behavior of `db_query`, in that it adds support for unbuffered queries. Previously, when selecting data from MySQL, the data for the query results of the entire query would be downloaded from the server before the first row could be processed. This has vastly negative effects when dumping large queries such as the entire %file_chunk table or the %ticket_thread table. Using unbuffered queries, the results are downloaded and handled from the server one at a time.