code: function(code) {
      var modules = [];
  
      var lex = Espruino.Core.Utils.getLexer(code);
      var tok = lex.next();
      var state = 0;
      while (tok!==undefined) {
        if (state==0 && tok.str=="require") {
          state=1;
        } else if (state==1 && tok.str=="(") {
          state=2;
        } else if (state==2 && (tok.type=="STRING")) {
          state=0;
          var module = tok.value;
          if (!isBuiltIn(module) && modules.indexOf(module)<0)
            modules.push(module);
        } else
          state = 0;
        tok = lex.next();
      }
  
      return modules;
    }
docs: Find any instances of require(...) in the code string and return a list