Add a pidfile attribute to resources, and change log_dir to logfile.  Fixes #4