added appdirs and changed log setup to be cross-platform