Update JQuery to 1.10.1 and QUnit to 1.11
Move gym.js to lib/
Use jQuery.Deferred to avoid callback nestings