added support for scrypt key derivation

Needed for multibit wallet support, code is mostly copied from scrypt-jane which is in the public domain.