Some refactoring and initial code for Hive-partitioned tables.

There are a few TODOs in the comments to address sketchy additions/API changes and possible refactorings.
The most notable one is SharkSemanticAnalyzer#analyzeCreateTable() regarding how Shark should create a cached table without CTAS.