Rewriting and simplification of merge commit

Done with Norman

Inline getMergePatches which is only used in the function

Use where clause function finalCheckoutWith for simplifying right hand side

Collapse [] and all identical confs into a single case
Change outcome type to be used in more places

Also added a new datatype for the result of merging the commits

minor shifting of code
Comments from meeting with Norman
Attempt at fixing possible bug