A few minor fixes,

Write now suppors strings correctly when the string is re-used.

Make "input" and "output" as text files, which are declared in Pascal and
used in the C runtime.