Derive multiple keys 3

This request includes pretty much everything that still has to be merged.

Please, review it.