Improve load save functionality

This pull request is a major rewrite of the save functionality. It fixes many of the open issues of the load->save functionality which I previously contributed. Major modifications of the emitted layout (segments are emitted at the beginning and free sections are moved to the end, section table gets emitted at the very end) where necessary to match the input elf files.

The only problem which I am aware of at the moment is that some input files contain GNU_RELRO segments with file/mem sizes that are not directly related to the contained sections. This strange property leads to differences after the saving. (The corresponding files are commented in the test suite.)

Additionally, a few further bug/warning fixes (22bd7ba,  8dda93f) and general improvements (c9cf1a6, 39b6782, c655d9b) are included.

An idea which I have not pursued at the moment but which should be considered for future is to expose the layout functionality as separate API from the save function.

Regards