Update initGitbook.R

This removes this error for me:

```
Error in if (grepl("r knitsetup.+\n", lines)) { : 
argument is of length zero
```

Main changes are, first, `mdfiles2 <- gsub("\\.md$", ".Rmd", mdfiles)` using double backslash to escape the period, so we can rename `md` files to `Rmd`, and second, 

```
 toMatch <- c("r knitsetup", "r setup")
 matches <- grepl(paste(toMatch,collapse="|"), lines)  
    suppressWarnings(if (!any(matches)) {
```

So we get just `TRUE` if there are any matches to either `r knitsetup` or `r setup` anywhere in the file, and we can exclude the `references.Rmd` from this insertion.