Avoid integer overflow in arc test.  Fixes #1918
Fix bridge detector
Test line direction is changed to reflect 0=east angle system
Test patern rotation direction is reversed - $angle represents infill direction
Angle test is changed to avoid returning negative value (this does happen otherwise - adding increments to $angle
creates ~ 1e-15 rounding error)
Fix test to check for correct direction and accept result close to 180 degrees.