Move file detection to ftdetect & fix global usage.

Use fallback to $GOROOT if g:golang_goroot variable is not set.