Added algorithms for collections, test for them. TODO: sort.