core: add persistent storage to Collection
For partitioned resources we always store their relations, so resources are assigned to the same partition after reboots. With this they will not change distributors if their IP address changes.
For some resources (like TBLink) we store all the resources, so they are kept between reboots. That was previously done in the internal module, now is moved to the Collection.
- Closes: #56 (closed), #106 (closed)