Add Source abstract class
Add LineAppendedSource class
[Refactoring] Add lineEndAfterBegin function

The first half of the lineEnd function of the Source and
LineAppendedSource classes were identical. This commit splits the
function, extracting the uncommon part of the function as a new virtual
function lineEndAfterBegin.

As a result of this commit, the lineEnd function is not overridden by
any subclasses, but it is still left virtual for possible future
overriding.