[CALCITE-282] Add {fn QUARTER(date)} function (Benoy Antony)

Close apache/incubator-calcite#13
Fix QUARTER function for null values and JDBC escape syntax
Make JsonHandler and JsonService thread-safe