Move build to gradle. Big reorganisation