Backend refactor

winter Feb 2021

Nothing is perfect from the beginning, but hopefully this time it lasts more than one year.

The old backend systems work but can be vastly improved in terms of performance, readability, expandability and more.

This is a big and boring task but it will make developing many of the other new features easier and faster.