Started to use flags to indicate database traits

e.g. support for any or outer join, or how string concatenation is
implemented
Added more checks for database traits