Add proper word-wrapping.

Also cleaned up a bit code.