First draft of new independent gradle build.

It's a little fragile but seems to work.