Make Jenkins test merge result of branches

Almost all of the time we are writing code to be merged into master sooner rather than later. Rather than testing the HEAD of the branch in Jenkins this makes the script merge the branch with master before building it.