Migrate to gradle

Hopefully got the structure of project right...