adjust the base js code, so it can be used with webpack

Hi, thanks for the all quick feedback so far,
here is the PR.

I tested it with the **Rest-example** project, in the nodejs, webpack and normal browser environments with this code:

    var Api = require("./api.js"); // api.js is the generated code
    var api = new Api("http://localhost:3000/");
    api.Post.list(function (s) {console.log(s)});