1. Creation of public & private key trees using seed (unlocked wallet emulation):
http://pastebin.mozilla-russia.org/111069
2. Creation of public keys tree using master public key and master chain code (locked wallet emulation):
http://pastebin.mozilla-russia.org/111070