Webclient: JavaScript cleanup

... regarding inheritance and instantiation.