[SQL] Refactors data type pattern matching

Refactors/adds extractors for `DataType` and `Binary*` types to ease and simplify data type related (nested) pattern matching.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/apache/spark/2764)
<!-- Reviewable:end -->