Cleaned up viewdistance and switched to new messaging system.

Also added missing eof newline.