Check out the Metasploit Unleashed project:
http://www.offensive-security.com/metasploit-unleashed/Main_PageMsfvenom:
http://www.offensive-security.com/metasploit-unleashed/Msfvenom 
Should help you as well ;-) About the tools, I haven't tried Metasploit 4, or haven't looked in the tools directory recently, but most functionality in the tools directory has either been integrated into the other main tools, and e.g., the exploit dev tools like pattern_create and pattern_offset can also be found in "Mona" (a immunity debugger plugin made by Corelan)