Use a metaclass to do the initialization automatically

Signed-off-by: Stefan Marr <git@stefan-marr.de>