Fast and exact comparison and clustering of sequences