Remade folders in rep, add selection sort, move general func to tools.h

Remade folders in rep, add selection sort, move general func to tools.h