Clean up factory functions

Get rid of unused functions and reduce overload crazy.
TemplateLiterals should normalize <CR> and <CR><LF> to <LF>

Fixes #1102