Core: refactor fetching composite values (#339).

The model, including its composite values, is fully fetched *before* the (attached) application object is created from it.

Storage API has 2 new methods:
    - fetchRelatedTopics(long id, ...
    - fetchRelatedAssociations(long id, ...
id is a topic ID or association ID

In preparation to "Attach CompositeValue to the database".
See ticket 339.