Store if branch is deleted in merge template
Position delete button
Only update deleted status when fetching a reference
Move methods to template
Fix deleted flag condition