Pull out the core printf stuff into printf_internal