Update README
Add freeing allocated memory
Modify way of testing algorithms to be more universal and to easily adding new algorithms