HIVE-4356 - refactor ThriftCLIService to make it easier to test
HIVE-4356 - adding test cases