Adding Codegen function and tests for CASE expressions.

Change-Id: Ib52b3e3f12b35e2c0a60ef94501c20ef83abdfe5
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3187
Reviewed-by: Paden Tomasello <paden.tomasello@cloudera.com>
Tested-by: jenkins
IMPALA-1059: Make backticking -d option argument idempotent

There was an issue with the previous fix to IMPALA-1059
if the user tried to reconnect within the shell after
having passed in a database via the -d option. The
passed database would be doubly backticked. This makes
the backticking of the argument idempotent.

Change-Id: I6eaed997c2be73d8659a2a12046ce393b97ec82c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3467
Reviewed-by: Abdullah Yousufi <abdullah.yousufi@cloudera.com>
Tested-by: jenkins