Adjusts HISTORY.
Fixes build in OS X.
Removes warnings due possible mismatching integer sizes.
Avoids possible division by zero in the regression test.
Ensures to always write not zero data in the regression test.
Reworks the test implementation.
Sort the dir alphabetically if explicitely requested.

This ensures that the test is independent of the directory order
of the files.