Refactored and cleaned up implementation.

Replaced use of jQuery.Deferred with RSVP.Promise.