Avoid bad initialization of application instances.

In `ApplicationInstance` and `CapabilityInstance` avoid bad instance initialization changing the constructors strategy. This solves some `NullPointerException`s.