Move encoding module into core.