reordered some functions, types. Deleted unused LineDiff type. Fixed another uncaught return val addcontext bug