Derive multiple keys

This changes add support for multiple key derivation.

Please, review them.