[SPARK-2393][SQL] Cost estimation optimization framework for Catalyst logical plans & sample usage.

The idea is that every Catalyst logical plan gets hold of an Estimates class, the usage of which provides useful estimations on various statistics. See the implementations of `ParquetRelation` and `MetastoreRelation`.

This patch also includes one usage of the estimation interface -- namely, use physical table sizes from the estimate interface to convert an equi-join to a broadcast join (when doing so is beneficial, as determined by a size threshold). 

This PR still needs some cleanups, but just want to put it out here first to gather feedback on the interface & high-level approach.

TODOs:  
- [x] Add a separate test suite & improve test coverage.
- [x] Support `ParquetRelation` in the aforementioned BHJ optimization.
We could certainly move it out of the Statistics class to reside in `MetastoreRelation`, but does `new Statistics` incur extra overheads? Otherwise I think the copy constructor may not be the good style here, as we have a long comment and relatively long implementation for the field `sizeInBytes`.