Move remaining functions into LinesKeeper class; add tests for those functions; delete commented out code.