Load JavaScript classes from a directory and instantiate inside code
<p>I am building a framework and one aspect is to automatically load JS classes defined in an directory named 'modules', instantiate them and then call their constructor function. If there is a way to pass arguments to this constructor function that would be awesome!</p>

<p>This technique is borrowed directly from Yii (if anyone is familiar with it). Any suggestions on how to implement this?</p>

<p>Thanks,
Mark</p>
