refactor and add tests to tailing
fix regression when going below the log zone

Since a431b68c2858a2d96f35accfe577497344de98a2, when going below the max
of the log files, the position button would remain in fixed position.
This fixes it.
Merge pull request #233 from dmathieu/tailing

Refactor tailing and test it