Topicmaps viewmodel: some refactoring (#660).

In preparation of "topics should be random accessible (by id)".

See #660.