A first implementation at #48

which I don’t like, as it is not type safe and also slow due to generic
programming.
Type safe register resolving