Bug 1111837 - Add failure callbacks

Also replaced MR_findFirstByAttribute with MR_findFirstOrCreateByAttribute where I could.