xbrick edge status partition update 25/8

restructured the code:
sorting when elem intact: find the most damged edge pair and ignore the
rest, set nfailedge=2

edge stat and elem stat updates are only for nfailedge=2 or 4 cases (one
or two pairs of broken edges) of the stored failed edges (newly failed
edges are ignored)