Close MySQL connection on plugin disable.
Change metaToJson to return JSONObject.

Also removed some debug code.