Naming clarifications and less magic numbers

Also makes some attempt at not blowing up the line array by resetting
the index when the maximum line length is reached. It can lead to weird
output for long output lines.