WHERE improvements

Now adding WHERE clauses is more natural (no need to call
DatabaseDriver->whereClause). The processing is done entirely on the fly
with some string manipulation functions.