Bug 1111837 - Add failure callbacks

Also replaced MR_findFirstByAttribute with MR_findFirstOrCreateByAttribute where I could.
Nit: No parens around if condition (here and elsewhere).