DRILL-1002: Fix TestSqlBracketlessSyntax.checkComplexExpressionParsing() on Windows
DRILL-836: [addendum] Drill needs to return complex types (e.g., map and array) as a JSON string

* This contains additional changes to the original patch which was merged.
+ Renamed "flatten" to "complex-to-json"
+ With the new patch, we return VARCHAR instead of VARBINARY.
+ Added test case.
+ Minor code re-factoring.
Commit dd2ae0ae got lost during merge, reintroducing the race condition.
DRILL-976: Fix extract second to return only second portion of interval; exclude hours, minutes
DRILL-995: Removed inner form (which is not allowed). Fixed NPE and URLs.
Improve error messaging for OperatorStats assertion messages.
DRILL-1001: Expanded ProfileWrapper content and formatting.
DRILL-699: Allow case insensitive function names in queries.