I battled with this task for much too long. My solution is posted on the forums: Load javascript client object model (ClientOM) (sp.js) from web part