Add documentation to cost_size and cleanup style.
Start writing documentation for cost2thresh.