Fixed problem with start-of-file newline stripping.

Also added auto-detection of code language.