Optimized imports, some work on porting of xmas module.