Support LTS Jenkins.
Massive refactor in order to add unit tests.