Make changeLine take a document, not an editor

Issue #2573
Move add/removeLineClass methods to document

The editor instances will inherit them from there.

Issue #2573