add autoload cookies and global minor-mode

resolve #2