JUnit 4; introduced GroovyJenkinsRule.
(cherry picked from commit 571de9c148ae34dd75e6bc8c6bb95527206cc870)
[FIXED JENKINS-19920] Using selfReference to mean “none” from nextBuild/previousBuild was just asking for trouble.
JENKINS-16194 and an analogous but opposite bug fixed more simply by introducing a separate NONE constant.
Also numberOnDisk did not get updated properly after a build was deleted, causing double loading of build records in some cases.
(cherry picked from commit 7ca4dc47ecff4c3eb3b8041e521fc076efc42767)

Conflicts:
	changelog.html