gradle: Change build to use new biz.aQute.bnd.gradle jar

Also moved the build logic into the proper gradle files instead of
applying it from cnf/gradle files. Using the cnf/gradle files caused
class loading issues since each gradle script has its own class loader
and projects did not inherit the class loader from the
cnf/gradle/master.gradle script but do inherit the class loader from
the build.gradle script.

Also updated headless build plugin to use new gradle plugin jar.