simplify and improve checkCookieFileIsWritable()

- Don't attempt to write a file to find out if it can be written;
  instead, check whether the current directory is writable.
  This prevents a "permission denied" error.
- Use a single if condition and therefore throw a single exception
- __SCRIPT__ is not defined and raises a Notice:
  "Use of undefined constant __SCRIPT__ - assumed '__SCRIPT__'".
  I assume dirname(__FILE__) was intended, but in that case it would
  return the current directory, when what is *really* needed is that
  the cookie file is writable. Changed the exception text to reflect that.
update README

- update instructions about the curl submodule
- format php code for syntax highlighting
- add step by step installation instructions (for Ubuntu)
- wrap some lines (both text and code)
- several minor tweaks and copyedit
add gitignore, to exclude the cookie file
minor change: format filename so it stands out
format code: no need for extra indentation
Merge pull request #18 from hamstar/waldir

Update README and improve cookie handling code