AMD support. more tests for defineResource. Changes DS.removeResource to DS.reset and fixes bugs with it.