refactor java backend to use more dependency injection

**please review**
why is a `Provider<Definition>` needed here? I guess you will have to decide on a `Definition` when there is more than one loaded. But how that the provider help here considering the `Definition` is simply `.get()`?