Higher bundle gerbes and cohomology classes in gauge theories