Update Gradle build, fix few issues.

This pull request contains:
- Upgrade Gradle build with latest libraries
- Tweak imports (mainly unused or wrong ones) to make it compile

Needed to remove an @Override annotation (present only in javax.ws.rs.core.Application >1.7), not clear why.