MDL-44106 add WS_SERVER constant to all web service calls

This will help us hack around some nasty webservice problems,
such as require_login() and it will be used to set proper 'ws' origin
in logged events.
MDL-44106 add origin info to $PAGE object and use it in logs