Added range versions for some files necessary for testing.

These files are needed where the algorithm header would be included otherwise.

Signed-off-by: Marcin Zalewski <marcin.zalewski@gmail.com>
Added lots of test.

This is intermediate state with some debug info.

Signed-off-by: Marcin Zalewski <marcin.zalewski@gmail.com>
Sort working.

Signed-off-by: Marcin Zalewski <marcin.zalewski@gmail.com>