improve feedback when lines are not sourced

Having specific error messages stating the reason for the sourcing error required a refactoring of the various `_is_sourced` methods. Those seems to be untested, so I added some new tests for them.

I will then refactor the methods to return a string with the error message, or maybe raise an exception.