Cookbook: implement Jenkins server recipe, plus a bit of refactoring and improvements.