Add bql parser and thrift refactor