Make ByLine use reference-counting

Note: ByLine was documented until recently.