src: migrate some modules to new constructors

Signed-off-by: Jean Privat <privat@pryen.org>