Move to gradle; update dependencies; rework