Optimized OFile

Removed many scans of the output buffer by keeping trace of buffer length.
Time needed to write a long line with a sequence of file.printf() is
now linear with line length. Before it was quatradic, causing problems
especially when logging huge atom lists at startup.