Add more algorithm implementations.

Basically copies you find in standard C++ library, but nonethless useful
things to have.