Ported main class of xmas module, ported some random classes.