Use .done()/.fail() instead of 'success'/'error'

'success' and 'error' are deprecated.

Also make all generateContents() promises abortable.

Change-Id: I8f95e9386f7749e635ce3715389896a0ccdb7523
Merge "Use .done()/.fail() instead of 'success'/'error'"