JavaScript code cleanup

Consistent use of whitespace, as in Java code
Use rap connection to send servicehandler request

Replace hard-coded server URL and obtain connection id directly in
JavaScript code. Java code does not need to deal with the cid anymore.