[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.
Setting large default values here (1) doesn't seem to make intuitive sense, and (2) can cause superfluous overflows when things are getting multiplied. 

This [commit](https://github.com/concretevitamin/spark/commit/f41ecf22d516bfeabc4168f2a1e6518169d85c29) introduced this change, which makes 1L a special default value that gets preserved even when a bunch of operators lack meaningful estimates -- because the default estimates will just multiply a bunch of 1's together, producing the special value 1L. With this preservation, we could test the absence of meaningful estimates and correspondingly do special handling, as shown in that commit. (One example in that commit: if RDDs don't have meaningful estimates, the field defaults to [SQLConf#statsDefaultSizeInBytes](https://github.com/apache/spark/pull/1238/files#diff-41ef65b9ef5b518f77e2a03559893f4dR61), which is set to be greater than the auto join conversion threshold.