Add functionlity to handle crossdomain requests.
Fix bugs. Add sid and password digesting.