Add wrapper method for getting line counts
Count lines on the fly if count is not available
Allow error reporting without precalculated line counts

As these can now be done on the fly
Merge pull request #728 from nijel/autolinecount

Automatic counting of lines for error reporting