Feature/gaborcsardi sync appdirs

@gaborcsardi made these changes on his fork to match behaviour/docs for appdirs. The main point is the handling of the `version` argument when `appname` is not specified.
So there are 5 cases of exactly the same pattern. 

```r
if (is.null(appname)) {
version <- NULL }