Move CDI code to its own module.