Another try to fix indexed tree containers.
After problems with reading back Conditions reported a week ago by @wlampl I wrote a new write/read test which detected some bugs in the index implementation.
This is a corrected version (with the test included).