WL#6510: Print cost and amount of data processes in EXPLAIN JSON

To provide to a user a better view on the query plans we can enhance JSON
EXPLAIN by printing following info:
.) total query cost
.) cost, per table
.) amount of data processed - (# of rows) * (record width) in G/M/K
This will make it easier for a user to see the difference between good and bad
plans.
User Documentation
==================
http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-2.html

Functional requirement:
----------------------
EXPLAIN JSON should print cost for following:
*) "query_cost" - total cost of a query block, no matter top query or a subquery.
*) "sort_cost" - cost of the first sorting operation (GROUP BY or ORDER BY) where
and if filesort is used. Cost for second sorting operation isn't printed as
optimizer doesn't calculate it.
*) "read_cost" - cost of reading for each table used in the query block.
*) "eval_cost" - cost of condition evaluation for each table in the query block.
*) "prefix_cost" - cost of executing prefix join in the query block.
*) "data_read_per_join" - estimated amount of data from the table processed
during single query block execution.
*) "rows_produced_per_join"/"rows_examined_per_scan" estimated number of records
from the table (per each table from the query block) produced/examined per single
query block execution.
*) "used_columns" - list of columns of the table (per each table in the query
block) used for either read or write in the query.
All new fields, except "used_columns", are wrapped in the "cost_info" JSON object
(see HLS for an example).
Non-functional requirements:
---------------------------
Costs are printed up to 2 digits after dot, since this is the planner's
precision.
If the cost value is bigger that 1E14 it's printed in the exponential notation
as '%.15g' which will give e.g 1.12345678901234E14.
When server provides value for the 'last_query_cost' variable it should be the
same as the 'query_cost' value provided by EXPLAIN JSON.

The WL is essentially about printing values we already have:
1) "query_cost": The value of JOIN::best_read. Printed by
Explain_join::shallow_explain().
2) "sort_cost": Optimize_table_order::consider_plan now saves a cost estimate
for filesort into the new JOIN::sort_cost variable. Printed by
Explain_join::shallow_explain().
3) "read_cost": The value of JOIN_TAB::position->read_time.
4) "eval_cost": JOIN_TAB::position->prefix_record_count * ROW_EVALUATE_COST.
5) "prefix_cost": The value of JOIN_TAB::position->prefix_cost.get_io_cost()
6) "data_read_per_join":
JOIN_TAB::position->prefix_record_count * JOIN_TAB->table->s->rec_buff_length.
7) "rows_produced_per_join": The value of JOIN_TAB::position->prefix_record_count.
"rows_examined_per_scan": The key is only renamed, its value is calculated as
before.
3-7 printed by Explain_join::explain_rows_and_filtered()
8) "used_columns" an additional loop in explain_join::explain_extra() goes
through all fields that has appropriate bit set in either TABLE::read_set or
TABLE::write_set and adds the field's name to the "used_columns" array.