Added cookieDomain configuration parameter, better code formatting for client.js