My first stab at dependancy injection in javascript.