Somewhat better printf implementation

Separates format parsing/printing from regular string printing, removes
all strlen() calls.