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.