New conversion module

Moves the existing TO_XXX lambda functions into their own module,
updating references from the package init.