Secondary index support

Robin,

Hereby the complete update for secondary index support. Please notice that the i2... routines are in the first commits but get removed in later commits. I added tests for the 2i routines.
Test for the ssl will made in a separate pr.

Regards,

Theo