You could wait for the document ready event. If you're using jquery it could be something like
$(document).ready(function () {
Module.foo();
});
var Module = (function () {
//Definition for Module
})();
The document ready function will wait for the document to be loaded to call your function. So it will parse all the javascript before it executes.