Optimize RequireJS projects using r.js. PLUS: ability to handle error states.