Supported execute history query API (as text/csv)

API request sample
------------------
    $ curl -H 'Accept: text/csv' http://localhost:9000/query/history/1/executed

* and some codes refactored
Supported query history update.