Allow cancelling of XHR downloads

This fixes #40 (the first part at least - the second is duplicated in issue 54)