Finished pass of dead code removal etc. Closes #25

- removed unused classes
- removed unused methods
- renamed some stuff to make sense
- light pass through functional flows, try to fix some obvious
  stuff
diff --git a/weinre.application/src/weinre/application/GUIMain.java b/weinre.application/src/weinre/application/GUIMain.java
index 47f52f7..7ae91a4 100644
--- a/weinre.application/src/weinre/application/GUIMain.java
+++ b/weinre.application/src/weinre/application/GUIMain.java
@@ -34,13 +34,14 @@
 
 //-------------------------------------------------------------------
 public class GUIMain extends Main {
-    private Display        display;
-    private Shell          shell;
-    private Browser        debugger;
-    private StyledText     console;
-    private Browser        homePage;
-    private Color          red;
-    private GUIPreferences preferences;
+    private Display          display;
+    private Shell            shell;
+    private Browser          debugger;
+    private StyledText       console;
+    private Browser          homePage;
+    private Color            red;
+    private GUIPreferences   preferences;
+    private ShellSizeTracker shellSizeTracker;
     
     //---------------------------------------------------------------
     static public void main(String[] args) {
@@ -49,13 +50,14 @@
     }
 
     //---------------------------------------------------------------
-    public GUIMain(String[] args) {
+    private GUIMain(String[] args) {
         super(args);
         
         preferences = new GUIPreferences();
     }
     
     //---------------------------------------------------------------
+    @Override
     public void run() {
         uiBuild();
 
@@ -73,166 +75,22 @@
     }
 
     //---------------------------------------------------------------
-    public GUIPreferences getPreferences() {
-        return preferences;
-    }
-    
-    //---------------------------------------------------------------
-    public void uiBuild() {
-        Display.setAppName("weinre");
-        Display.setAppVersion("???");
-        
-        display = new Display();
-        shell   = new Shell(display);
-        
-        red = new Color(display, 255, 0, 0);
-
-        shell.setText("weinre - Web Inspector Remote");
-        
-        CTabFolder tabFolder       = new CTabFolder(shell, SWT.BORDER);
-        CTabItem   tabItemDebugger = createTabItem(tabFolder, "Debugger");
-        CTabItem   tabItemConsole  = createTabItem(tabFolder, "Server Console");
-        CTabItem   tabItemHomePage = createTabItem(tabFolder, "Server Home Page");
-
-        debugger = new Browser(tabFolder, SWT.NONE);
-        tabItemDebugger.setControl(debugger);
-        
-        console = new StyledText(tabFolder, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-        console.setEditable(false);
-        console.setFont(getMonospaceFont(console));
-
-        homePage = new Browser(tabFolder, SWT.NONE);
-        tabItemHomePage.setControl(homePage);
-        
-        tabItemConsole.setControl(console);
-        
-        fillParent(debugger,  0, 0, 0, 0);
-        fillParent(console,   0, 0, 0, 0);
-        fillParent(homePage,  0, 0, 0, 0);
-        fillParent(tabFolder, 5, 5, 5, 5);
-        
-        tabFolder.pack();
-        createMenuBar();
-        
-        new ShellSizeTracker("main", shell, preferences);
-        
-        try {
-            String       boundsKey = preferences.getBoundsKey(shell, "main");
-            JSONObject   bounds    = preferences.getPreferenceFromJSON(boundsKey);
-            
-            if (null != bounds) {
-                Integer x, y, w, h;
-                try {
-                    x = bounds.getInt("x");
-                    y = bounds.getInt("y");
-                    w = bounds.getInt("width");
-                    h = bounds.getInt("height");
-                } catch (JSONException e) {
-                    throw new RuntimeException(e);
-                }
-                
-                if ((null != w) && (null != h)) {
-                    shell.setBounds(x,y,w,h);
-                }
-            }
-            
-            else {
-                shell.setBounds(100, 100, 500, 300);
-            }
-            
-        }
-        catch (IOException e) {
-            Main.warn("exception reading preferences: " + e);
-        }
-        
-    }
- 
-    //---------------------------------------------------------------
-    private void createMenuBar() {
-//        Menu menu = new Menu(shell, SWT.BAR);
-//        shell.setMenuBar(menu);
-//        MenuItem fileMenuItem = new MenuItem(menu, SWT.CASCADE);
-//        fileMenuItem.setText("File");
-//        MenuItem editMenuItem = new MenuItem(menu, SWT.CASCADE);
-//        editMenuItem.setText("Edit");
-     }        
-
-    //---------------------------------------------------------------
-    public void uiRun() {
-        shell.open();
-        
-        while (!shell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-        display.dispose();
-    }
-
-    //---------------------------------------------------------------
-    public CTabItem createTabItem(CTabFolder tabFolder, String text) {
-        CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
-        tabItem.setText(text);
-        
-        Font       font     = tabItem.getFont();
-        FontData[] fontData = font.getFontData();
-        
-        for (FontData fontDatum: fontData) {
-            double newHeight = fontDatum.getHeight() * 1.25;
-            fontDatum.setHeight((int) newHeight);
-        }
-        
-        font = new Font(display, fontData);
-        tabItem.setFont(font);
-        
-        return tabItem;
-    }
-    
-    //---------------------------------------------------------------
-    public void fillParent(Control control, int marginT, int marginR, int marginB, int marginL ) {
-        FormLayout formLayout = new FormLayout();
-        
-        formLayout.marginTop    = marginT; 
-        formLayout.marginBottom = marginB;
-        formLayout.marginLeft   = marginL;
-        formLayout.marginRight  = marginR;
-        
-        FormData formData = new FormData();
-        
-        formData.left     = new FormAttachment(0);
-        formData.right    = new FormAttachment(100);
-        formData.top      = new FormAttachment(0);
-        formData.bottom   = new FormAttachment(100);
-
-        control.getParent().setLayout(formLayout);
-        control.setLayoutData(formData);
-    }
-    
-    //---------------------------------------------------------------
+    @Override
     public void serverStarted() {
         debugger.getDisplay().asyncExec(new Runnable() {
             public void run() {
-                debugger.setUrl(getBrowserURL() + "client/index.html");
-                homePage.setUrl(getBrowserURL() + "index.html");
+                debugger.getDisplay().timerExec(1000, new Runnable() {
+                    public void run() {
+                        debugger.setUrl(getBrowserURL() + "client/index.html");
+                        homePage.setUrl(getBrowserURL() + "index.html");
+                    }
+                });
             }
         });
     }
-    
+
     //---------------------------------------------------------------
-    public String getBrowserURL() {
-        String result;
-        
-        ServerSettings settings = weinre.server.Main.getSettings();
-        
-        String host = settings.getNiceHostName();
-        int    port = settings.getHttpPort();
-        
-        result = "http://" + host + ":" + port + "/";
-        
-        return result;
-    }
-    
-    
-    //---------------------------------------------------------------
+    @Override
     public void addServerConsoleMessage(final String line, final boolean stdout) {
         if (null == console) return;
         
@@ -258,7 +116,6 @@
         });
     }
     
-    
     //---------------------------------------------------------------
     @Override
     public int severeError(final String message) {
@@ -290,6 +147,151 @@
     }
     
     //---------------------------------------------------------------
+    private void uiBuild() {
+        Display.setAppName("weinre");
+        Display.setAppVersion("???");
+        
+        display = new Display();
+        shell   = new Shell(display);
+        
+        red = new Color(display, 255, 0, 0);
+
+        shell.setText("weinre - Web Inspector Remote");
+        
+        CTabFolder tabFolder       = new CTabFolder(shell, SWT.BORDER | SWT.BOTTOM);
+        CTabItem   tabItemDebugger = createTabItem(tabFolder, "Debugger");
+        CTabItem   tabItemConsole  = createTabItem(tabFolder, "Server Console");
+        CTabItem   tabItemHomePage = createTabItem(tabFolder, "Server Home Page");
+
+        debugger = new Browser(tabFolder, SWT.NONE);
+        tabItemDebugger.setControl(debugger);
+        
+        console = new StyledText(tabFolder, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+        console.setEditable(false);
+        console.setFont(getMonospaceFont(console));
+
+        homePage = new Browser(tabFolder, SWT.NONE);
+        tabItemHomePage.setControl(homePage);
+        
+        tabItemConsole.setControl(console);
+        
+        fillParent(debugger,  0, 0, 0, 0);
+        fillParent(console,   0, 0, 0, 0);
+        fillParent(homePage,  0, 0, 0, 0);
+        fillParent(tabFolder, 5, 5, 5, 5);
+        
+        tabFolder.pack();
+        createMenuBar();
+        
+        shellSizeTracker = new ShellSizeTracker("main", shell, preferences);
+        shellSizeTracker.start();
+        
+        try {
+            String       boundsKey = ShellSizeTracker.getBoundsKey(shell, "main");
+            JSONObject   bounds    = preferences.getPreference(boundsKey);
+            
+            if (null != bounds) {
+                Integer x, y, w, h;
+                try {
+                    x = bounds.getInt("x");
+                    y = bounds.getInt("y");
+                    w = bounds.getInt("width");
+                    h = bounds.getInt("height");
+                } catch (JSONException e) {
+                    throw new RuntimeException(e);
+                }
+                
+                if ((null != w) && (null != h)) {
+                    shell.setBounds(x,y,w,h);
+                }
+            }
+            
+            else {
+                shell.setBounds(100, 100, 700, 500);
+            }
+            
+        }
+        catch (IOException e) {
+            Main.warn("exception reading preferences: " + e);
+        }
+        
+    }
+ 
+    //---------------------------------------------------------------
+    private void createMenuBar() {
+//        Menu menu = new Menu(shell, SWT.BAR);
+//        shell.setMenuBar(menu);
+//        MenuItem fileMenuItem = new MenuItem(menu, SWT.CASCADE);
+//        fileMenuItem.setText("File");
+//        MenuItem editMenuItem = new MenuItem(menu, SWT.CASCADE);
+//        editMenuItem.setText("Edit");
+     }        
+
+    //---------------------------------------------------------------
+    private void uiRun() {
+        shell.open();
+        
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch())
+                display.sleep();
+        }
+        display.dispose();
+    }
+
+    //---------------------------------------------------------------
+    private CTabItem createTabItem(CTabFolder tabFolder, String text) {
+        CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
+        tabItem.setText(text);
+        
+        Font       font     = tabItem.getFont();
+        FontData[] fontData = font.getFontData();
+        
+        for (FontData fontDatum: fontData) {
+            double newHeight = fontDatum.getHeight() * 1.25;
+            fontDatum.setHeight((int) newHeight);
+        }
+        
+        font = new Font(display, fontData);
+        tabItem.setFont(font);
+        
+        return tabItem;
+    }
+    
+    //---------------------------------------------------------------
+    private void fillParent(Control control, int marginT, int marginR, int marginB, int marginL ) {
+        FormLayout formLayout = new FormLayout();
+        
+        formLayout.marginTop    = marginT; 
+        formLayout.marginBottom = marginB;
+        formLayout.marginLeft   = marginL;
+        formLayout.marginRight  = marginR;
+        
+        FormData formData = new FormData();
+        
+        formData.left     = new FormAttachment(0);
+        formData.right    = new FormAttachment(100);
+        formData.top      = new FormAttachment(0);
+        formData.bottom   = new FormAttachment(100);
+
+        control.getParent().setLayout(formLayout);
+        control.setLayoutData(formData);
+    }
+    
+    //---------------------------------------------------------------
+    private String getBrowserURL() {
+        String result;
+        
+        ServerSettings settings = weinre.server.Main.getSettings();
+        
+        String host = settings.getNiceHostName();
+        int    port = settings.getHttpPort();
+        
+        result = "http://" + host + ":" + port + "/";
+        
+        return result;
+    }
+    
+    //---------------------------------------------------------------
     private Font getMonospaceFont(Control control) {
         FontData[] fontData = control.getDisplay().getFontList(null, true);
         
diff --git a/weinre.application/src/weinre/application/GUIPreferences.java b/weinre.application/src/weinre/application/GUIPreferences.java
index 7b6fd54..200ea0a 100644
--- a/weinre.application/src/weinre/application/GUIPreferences.java
+++ b/weinre.application/src/weinre/application/GUIPreferences.java
@@ -7,88 +7,31 @@
 
 package weinre.application;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.util.Properties;
 
 import org.apache.wink.json4j.JSONException;
 import org.apache.wink.json4j.JSONObject;
-import org.eclipse.swt.widgets.Shell;
 
-import weinre.server.Main;
+import weinre.server.Utility;
 
 
 //-------------------------------------------------------------------
 public class GUIPreferences {
+    static final private String PROPERTIES_FILE_NAME = "ui.properties";
+    
     private Properties properties;
-    private String     fileName;
     
     //---------------------------------------------------------------
     public GUIPreferences() {
         super();
 
-        properties = new Properties();
-        fileName   = null;
-        
-        String userHome = System.getProperty("user.home");
-        if (null == userHome) {
-            Main.warn("System property user.home not set!");
-            return;
-        }
-        
-        File dir = new File(userHome, ".weinre");
-        if (!dir.exists()) {
-            dir.mkdirs();
-        }
-        
-        File file = new File(dir, "ui.properties");
-        fileName = file.getAbsolutePath();
-        
-        if (!file.exists()) return;
-        
-        loadFromFile();
-    }
-
-    //---------------------------------------------------------------
-    public String getBoundsKey(Shell shell, String name) {
-        return "bounds-" + name + "-" + ShellSizeTracker.getMonitorSetupKey(shell.getDisplay());        
+        properties = Utility.readPropertiesFile(PROPERTIES_FILE_NAME);
     }
     
     //---------------------------------------------------------------
-    public void loadFromFile() {
-        properties.clear();
-        
-        try {
-            properties.load(new FileReader(fileName));
-        }
-        catch (IOException e) {
-            Main.warn("IOException reading '" + fileName + "': " + e);
-        }
-    }
-
-    //---------------------------------------------------------------
-    public void saveToFile() {
-        if (null == fileName) return;
-        
-        try {
-            properties.store(new FileWriter(fileName), "ui settings");
-        }
-        catch (IOException e) {
-            Main.warn("IOException writing '" + fileName + "': " + e);
-        }
-    }
-    
-    //---------------------------------------------------------------
-    public String getPreference(String key) {
-        if (null == properties) loadFromFile();
-        return properties.getProperty(key);
-    }
-    
-    //---------------------------------------------------------------
-    public JSONObject getPreferenceFromJSON(String key) throws IOException {
-        String val = getPreference(key);
+    public JSONObject getPreference(String key) throws IOException {
+        String val = properties.getProperty(key);
         if (null == val) return null;
 
         try {
@@ -99,15 +42,11 @@
     }
     
     //---------------------------------------------------------------
-    public void setPreference(String key, String val) {
-        properties.setProperty(key, val);
-    }
-
-    //---------------------------------------------------------------
-    public void setPreference(String key, JSONObject json) throws IOException {
+    public void setPreference(String key, JSONObject json) {
         String val = json.toString();
         
         properties.setProperty(key, val);
+        Utility.writePropertiesFile(PROPERTIES_FILE_NAME, properties);
     }
 
 }
diff --git a/weinre.application/src/weinre/application/ShellSizeTracker.java b/weinre.application/src/weinre/application/ShellSizeTracker.java
index b661b6e..5fbad4b 100644
--- a/weinre.application/src/weinre/application/ShellSizeTracker.java
+++ b/weinre.application/src/weinre/application/ShellSizeTracker.java
@@ -27,9 +27,15 @@
     private Point          lastSize;
     private Point          lastLocation;
     private long           lastChange;
+    private boolean        stop;
 
     //---------------------------------------------------------------
-    static public String getMonitorSetupKey(final Display display) {
+    static public String getBoundsKey(Shell shell, String name) {
+        return "bounds-" + name + "-" + ShellSizeTracker.getMonitorSetupKey(shell.getDisplay());        
+    }
+    
+    //---------------------------------------------------------------
+    static private String getMonitorSetupKey(final Display display) {
         StringBuffer keyBuffer = new StringBuffer();
 
         Monitor[] monitors = display.getMonitors();
@@ -65,17 +71,26 @@
         this.dirty        = false;
         this.lastSize     = new Point(0,0);
         this.lastLocation = new Point(0,0);
+        this.stop         = false;
         
         shell.addControlListener(new ControlListener() {
             public void controlMoved(ControlEvent e)   {shellMoved();}
             public void controlResized(ControlEvent e) {shellMoved();}
         });
         
-        System.out.println("monitor key: " + getMonitorSetupKey(shell.getDisplay()));
-        startWaiterThread();
     }
 
     //---------------------------------------------------------------
+    public void start() {
+        startWaiterThread();
+    }
+    
+    //---------------------------------------------------------------
+    public void stop() {
+        
+    }
+    
+    //---------------------------------------------------------------
     private void shellMoved() {
         dirty        = true;
         lastChange   = System.currentTimeMillis();
@@ -101,13 +116,10 @@
         }
         
         String key;
-        String val;
-        key = preferences.getBoundsKey(shell, name);
-        val = valueJSON.toString();
+        key = ShellSizeTracker.getBoundsKey(shell, name);
         
-        preferences.setPreference(key, val);
-        preferences.saveToFile();
-        
+        preferences.setPreference(key, valueJSON);
+
         dirty = false;
     }
 
@@ -119,6 +131,7 @@
                 while (true) {
                     try { Thread.sleep(1000); } catch(InterruptedException e) { return; }
                     
+                    if (stop) return;
                     if (shell.isDisposed()) return;
                     
                     shell.getDisplay().asyncExec(new Runnable() {
diff --git a/weinre.server/src/weinre/server/BasicService.java b/weinre.server/src/weinre/server/BasicService.java
deleted file mode 100644
index 9265520..0000000
--- a/weinre.server/src/weinre/server/BasicService.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * weinre is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2010, 2011 IBM Corporation
- */
-
-package weinre.server;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.wink.json4j.JSONArray;
-
-//-------------------------------------------------------------------
-public abstract class BasicService {
-
-    public static String lastActivePanelName;
-    
-    //---------------------------------------------------------------
-    public BasicService() {
-        super();
-    }
-
-    //---------------------------------------------------------------
-    public String getInterfaceName() {
-        return getClass().getSimpleName();
-    }
-    
-    //---------------------------------------------------------------
-    public void __doesNotUnderstand(Channel channel, String methodName, JSONArray args) throws IOException {
-        Connector connector = channel.getConnector();
-        if (null == connector) return;
-        
-        List<Connector> connections = connector.getConnections();
-        
-        for (Connector connection: connections) {
-            connection.getChannel().sendEvent(getInterfaceName(), methodName, args.toArray());
-        } 
-    }
-
-}
diff --git a/weinre.server/src/weinre/server/ScriptEventQueue.java b/weinre.server/src/weinre/server/ScriptEventQueue.java
deleted file mode 100644
index 9a32497..0000000
--- a/weinre.server/src/weinre/server/ScriptEventQueue.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * weinre is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2010, 2011 IBM Corporation
- */
-
-package weinre.server;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-//-------------------------------------------------------------------
-public class ScriptEventQueue {
-
-    static public ScriptEventQueue $ = new ScriptEventQueue();
-    
-    private BlockingQueue<String> queue;
-    private AtomicBoolean         closed;
-    
-    //---------------------------------------------------------------
-    private ScriptEventQueue() {
-        super();
-        
-        this.queue = new LinkedBlockingQueue<String>();
-        this.closed = new AtomicBoolean(false);
-    }
-
-    //---------------------------------------------------------------
-    public void close() {
-        closed.set(true);
-    }
-    
-    //---------------------------------------------------------------
-    public boolean isClosed() {
-        return closed.get();
-    }
-
-    //---------------------------------------------------------------
-    public void add(String item) {
-        if (isClosed()) return;
-        
-        queue.add(item);
-    }
-    
-    //---------------------------------------------------------------
-    public String getNext() {
-        if (isClosed()) return null;
-        
-        String result;
-
-        try {
-            result = queue.poll(5, TimeUnit.SECONDS);
-        }
-        catch (InterruptedException e) {
-            result = null;
-        }
-        
-        return result;
-    }
-    
-}
diff --git a/weinre.server/src/weinre/server/ServerConsoleUpdater.java b/weinre.server/src/weinre/server/ServerConsoleUpdater.java
deleted file mode 100644
index db395f3..0000000
--- a/weinre.server/src/weinre/server/ServerConsoleUpdater.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * weinre is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2010, 2011 IBM Corporation
- */
-
-package weinre.server;
-
-//-------------------------------------------------------------------
-public class ServerConsoleUpdater {
-
-    //---------------------------------------------------------------
-    public ServerConsoleUpdater() {
-        super();
-    }
-    
-    //---------------------------------------------------------------
-    public boolean addServerConsoleMessage(String message, boolean stdout) {
-        return false;
-    }
-    
-}
diff --git a/weinre.server/src/weinre/server/http/HttpServer.java b/weinre.server/src/weinre/server/http/HttpServer.java
index 21fc684..bfc07f4 100644
--- a/weinre.server/src/weinre/server/http/HttpServer.java
+++ b/weinre.server/src/weinre/server/http/HttpServer.java
@@ -50,11 +50,8 @@
         Server server = new Server();
         server.setConnectors(new Connector[] { connector });
         server.addLifeCycleListener(new LifeCycle.Listener() {
-            public void lifeCycleStarting(LifeCycle event) {
-                main.serverStarted();
-            }
-
-            public void lifeCycleStarted(LifeCycle event) {}
+            public void lifeCycleStarting(LifeCycle event) {}
+            public void lifeCycleStarted(LifeCycle event) { main.serverStarted(); }
             public void lifeCycleFailure(LifeCycle event, Throwable cause) {}
             public void lifeCycleStopping(LifeCycle event) {}
             public void lifeCycleStopped(LifeCycle event) {}
diff --git a/weinre.web/client/weinre/client.css b/weinre.web/client/weinre/client.css
index 4aae174..7469c56 100644
--- a/weinre.web/client/weinre/client.css
+++ b/weinre.web/client/weinre/client.css
@@ -9,6 +9,11 @@
     background-image: url(../../images/weinre-icon-32x32.png);
 }
 
+body.platform-weinre .monospace, body.platform-weinre .source-code {
+     font-size:   12px;
+     font-family: Monaco, Consolas, Lucida Console, dejavu sans mono, monospace;
+}
+
 .weinre-connector-item {
     font-size: 140%;
 }
@@ -40,36 +45,20 @@
     font-size: 200%
 }
 
-.weinreConsole {
-    margin-left: 2em;
-}
-
 .weinreServerProperties {
     margin-left: 2em;
 }
 
-.console_stdout {
-    color: #000;
-}
-
-.console_stderr {
-    color: #F00;
-}
-
 .weinre-normal-text-size {
     font-size: 140%;
 }
 
-body.platform-weinre .monospace, body.platform-weinre .source-code {
-     font-size:   12px;
-     font-family: Monaco, Consolas, Lucida Console, dejavu sans mono, monospace;
-}
-
-.fadeable {
+.weinre-fadeable {
   opacity: 1;
   -webkit-transition: opacity 5s linear;
 }
 
-.fade {
+.weinre-fade {
   opacity: 0;
 }
+
diff --git a/weinre.web/modules/weinre/client/Client.scoop b/weinre.web/modules/weinre/client/Client.scoop
index 00eb4b5..9bebe40 100644
--- a/weinre.web/modules/weinre/client/Client.scoop
+++ b/weinre.web/modules/weinre/client/Client.scoop
@@ -28,27 +28,6 @@
     Weinre.showNotImplemented()
 
 //-----------------------------------------------------------------------------
-static method autoConnect(value)
-    if (arguments.length >= 1) {
-        AutoConnect = !!value
-        
-        if (Client.uiAvailable) {
-            WebInspector.panels.remote.autoConnect(AutoConnect)
-        }
-    }
-
-    return AutoConnect
-
-//-----------------------------------------------------------------------------
-method autoConnect(value)
-    if (arguments.length >= 1) {
-        return Client.autoConnect(value)
-    }
-    else {
-        return Client.autoConnect()
-    }
-
-//-----------------------------------------------------------------------------
 method initialize
 
     // validate InspectorFrontendHost against IDL
@@ -75,29 +54,18 @@
     return WebInspector.panels && WebInspector.panels.remote
     
 //-----------------------------------------------------------------------------
-method _installRemotePanelEventually
-    var self = this
-    
-    setTimeout(function() {
-        var wait = false
-        if (!WebInspector.applicationSettings) wait = true
-        
-        if (wait) {
-            self._installRemotePanelEventually()
-            return
-        }
-        
-        self._installRemotePanel()
-    }, 10)
+method autoConnect(value)
+    if (arguments.length >= 1) {
+        AutoConnect = !!value
+    }
 
+    return AutoConnect
 
 //-----------------------------------------------------------------------------
 method _installRemotePanel
-
     WebInspector.panels.remote = new RemotePanel();
     
     var panel   = WebInspector.panels.remote;
-    panel.autoConnect(Client.autoConnect())
     
     var toolbar = document.getElementById("toolbar")
     WebInspector.addPanelToolbarIcon(toolbar, panel, toolbar.childNodes[1])
diff --git a/weinre.web/modules/weinre/client/ConnectorList.scoop b/weinre.web/modules/weinre/client/ConnectorList.scoop
index 47e20f2..92558cb 100644
--- a/weinre.web/modules/weinre/client/ConnectorList.scoop
+++ b/weinre.web/modules/weinre/client/ConnectorList.scoop
@@ -33,7 +33,7 @@
         this.noneItem.style.display = "none"
     }
     
-    li.addStyleClass("fadeable")
+    li.addStyleClass("weinre-fadeable")
     
     var insertionPoint = this.getConnectorInsertionPoint(connector)
     if (!insertionPoint) {
@@ -86,7 +86,7 @@
 
     else {
         this.setState(element, "closed")
-        element.addStyleClass("fade")
+        element.addStyleClass("weinre-fade")
 
         window.setTimeout(function() {
             self._remove(element)
diff --git a/weinre.web/modules/weinre/client/DOMTemplates.scoop b/weinre.web/modules/weinre/client/DOMTemplates.scoop
index 837a0c8..566c1b4 100644
--- a/weinre.web/modules/weinre/client/DOMTemplates.scoop
+++ b/weinre.web/modules/weinre/client/DOMTemplates.scoop
@@ -7,7 +7,7 @@
  */
 
 //-----------------------------------------------------------------------------
-// creates functions of the form _H1_, _H2_, etc, that create a new element
+// creates functions of the form H1, H2, etc, as static methods that create a new element
 // of the specified name.  The function can take a variable number of arguments,
 // which are either child elements, strings, attributes, or properties of the element.
 //
@@ -24,10 +24,6 @@
 //-----------------------------------------------------------------------------
 class DOMTemplates
 
-init 
-    var ElementNames = "H1 H2 H3 H4 H5 H6 UL OL DL LI DT DD SPAN DIV A B I TT P HR BR PRE IMG CANVAS TABLE TR TD FORM INPUT BUTTON SELECT OPTGROUP OPTION TEXTAREA"
-    ElementNames = ElementNames.split(" ")
-
 //-----------------------------------------------------------------------------
 function getElementFunction(elementName)
     return function() {
@@ -70,6 +66,9 @@
 
 //-----------------------------------------------------------------------------
 init 
-    ElementNames.forEach(function(elementName) {
+    var elementNames = "H1 H2 H3 H4 H5 H6 UL OL DL LI DT DD SPAN DIV A B I TT P HR BR PRE IMG CANVAS TABLE TR TD FORM INPUT BUTTON SELECT OPTGROUP OPTION TEXTAREA"
+    elementNames = elementNames.split(" ")
+    
+    elementNames.forEach(function(elementName) {
         DOMTemplates[elementName] = getElementFunction(elementName)
     })
diff --git a/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop b/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
index c7f2ca6..f4aeb73 100644
--- a/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
+++ b/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
@@ -37,15 +37,21 @@
 
     intfNames.forEach(function(intfName) {
         var proxy = Weinre.messageDispatcher.createProxy(intfName)
+        if (window[intfName]) {
+            throw new Ex(arguments, "backend interface '" + intfName + "' already created")
+        }
         
         var intf = IDLTools.getIDL(intfName)
         if (!intf) {
             throw new Ex(arguments, "interface not registered: '" + intfName + "'")
         }
+
+        window[intfName] = {}
         
         intf.methods.forEach(function(method) {
             var proxyMethod = InspectorBackendImpl.getProxyMethod(proxy, method)
             InspectorBackendImpl.prototype[method.name] = proxyMethod
+            window[intfName][method.name] = proxyMethod
         })
     })
     
diff --git a/weinre.web/modules/weinre/client/RemotePanel.scoop b/weinre.web/modules/weinre/client/RemotePanel.scoop
index 909da5e..b316f0f 100644
--- a/weinre.web/modules/weinre/client/RemotePanel.scoop
+++ b/weinre.web/modules/weinre/client/RemotePanel.scoop
@@ -19,16 +19,7 @@
     this.initialize()
 
 //-----------------------------------------------------------------------------
-method autoConnect(value)
-    if (arguments.length >= 1) {
-        this._autoConnect = !!value
-    }
-
-    return this._autoConnect
-
-//-----------------------------------------------------------------------------
 method initialize()
-    this.autoConnect(false)
     
     // main div
     var div = dt.DIV()
@@ -118,7 +109,7 @@
         this.addTarget(target)
     }, this)
    
-    if (!this.autoConnect()) return
+    if (!Weinre.client.autoConnect()) return
     
     var newestTargetId = this.getNewestTargetId()
     if (!newestTargetId) return
diff --git a/weinre.web/modules/weinre/client/WeinreClientEventsImpl.scoop b/weinre.web/modules/weinre/client/WeinreClientEventsImpl.scoop
index c8057d6..1dc8b3c 100644
--- a/weinre.web/modules/weinre/client/WeinreClientEventsImpl.scoop
+++ b/weinre.web/modules/weinre/client/WeinreClientEventsImpl.scoop
@@ -25,7 +25,7 @@
         WebInspector.panels.remote.addTarget(targetDescription)
     }
     
-    if (!this.client.autoConnect()) return
+    if (!Weinre.client.autoConnect()) return
     
     Weinre.WeinreClientCommands.connectTarget(Weinre.clientId, targetDescription.id)
 
@@ -63,7 +63,7 @@
     
     Weinre.targetId = null
     
-    if (!this.client.autoConnect()) return
+    if (!Weinre.client.autoConnect()) return
     if (!this.client.uiAvailable()) return
     
     var nextTargetId = WebInspector.panels.remote.getNewestTargetId(targetId)
diff --git a/weinre.web/modules/weinre/common/MessageDispatcher.scoop b/weinre.web/modules/weinre/common/MessageDispatcher.scoop
index 6477e0c..038c43a 100644
--- a/weinre.web/modules/weinre/common/MessageDispatcher.scoop
+++ b/weinre.web/modules/weinre/common/MessageDispatcher.scoop
@@ -42,10 +42,6 @@
     return Verbose
 
 //-----------------------------------------------------------------------------
-method open
-    Weinre.deprecated()
-
-//-----------------------------------------------------------------------------
 method _open
     if (this._opened || this._opening) return
     if (this._closed) throw new Ex(arguments, "socket has already been closed")
@@ -165,16 +161,24 @@
         intf = InspectorBackend.getRegisteredDomainDispatcher(intfName.substr(0,intfName.length-6))
     }
     
-    if (!intf) throw new Ex(arguments, "request for non-registered interface:" + methodSignature)
+    if (!intf) {
+        console.log("weinre: request for non-registered interface:" + methodSignature)
+        return
+    }
+    
+    methodSignature = intf.constructor.name + "." + methodName + "()"
     
     var method = intf[methodName]
-    if (typeof method != "function") throw new Ex(arguments, "request for unknown method on interface: " + methodSignature)
+    if (typeof method != "function") {
+        Weinre.notImplemented(methodSignature)
+        return
+    }
     
     try {
         method.apply(intf, args)
     }
     catch (e) {
-        console.log("Weinre.Socket._handleMessage() invocation exception on " + methodSignature + ": " + e)
+        console.log("weinre: invocation exception on " + methodSignature + ": " + e)
     }
     
     if (Verbose) {
diff --git a/weinre.web/modules/weinre/common/Weinre.scoop b/weinre.web/modules/weinre/common/Weinre.scoop
index 69f58f1..ea9f5a1 100644
--- a/weinre.web/modules/weinre/common/Weinre.scoop
+++ b/weinre.web/modules/weinre/common/Weinre.scoop
@@ -43,11 +43,11 @@
     _notImplemented[thing] = true
     
     if (!_showNotImplemented) return
-    console.log(thing + " not implemented")
+    console.log("weinre: " + thing + " not implemented")
 
 //-----------------------------------------------------------------------------
 static method showNotImplemented()
     _showNotImplemented = true
     for (var key in _notImplemented) {
-        console.log(key + " not implemented")
+        console.log("weinre: " + key + " not implemented")
     }
\ No newline at end of file
diff --git a/weinre.web/modules/weinre/target/InjectedScriptHostImpl.scoop b/weinre.web/modules/weinre/target/InjectedScriptHostImpl.scoop
index a28667a..48cf458 100644
--- a/weinre.web/modules/weinre/target/InjectedScriptHostImpl.scoop
+++ b/weinre.web/modules/weinre/target/InjectedScriptHostImpl.scoop
@@ -13,13 +13,9 @@
 
 //-----------------------------------------------------------------------------
 method clearConsoleMessages(callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method copyText(/*string*/ text, callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
+    if (callback) {
+        Weinre.WeinreTargetCommands.sendClientCallback(callback)
+    }
 
 //-----------------------------------------------------------------------------
 method nodeForId(/*int*/ nodeId, callback)
@@ -43,36 +39,6 @@
     return nodeId
 
 //-----------------------------------------------------------------------------
-method currentCallFrame(callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method selectDatabase(/*any*/ database, callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method selectDOMStorage(/*any*/ storage, callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method didCreateWorker(/*int*/ id, /*string*/ url, /*boolean*/ isFakeWorker, callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method didDestroyWorker(/*int*/ id, callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
-method nextWorkerId(callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
-
-//-----------------------------------------------------------------------------
 method internalConstructorName(object)
     var ctor = object.constructor
     
diff --git a/weinre.web/modules/weinre/target/WeinreTargetEventsImpl.scoop b/weinre.web/modules/weinre/target/WeinreTargetEventsImpl.scoop
index 65098f1..6eebf46 100644
--- a/weinre.web/modules/weinre/target/WeinreTargetEventsImpl.scoop
+++ b/weinre.web/modules/weinre/target/WeinreTargetEventsImpl.scoop
@@ -25,6 +25,8 @@
         console.log(message)
     }
     
+    Weinre.showNotImplemented()
+
     Weinre.target.setDocument()
 
 //-----------------------------------------------------------------------------
diff --git a/weinre.web/modules/weinre/target/WiInspectorImpl.scoop b/weinre.web/modules/weinre/target/WiInspectorImpl.scoop
index 3cf20a9..26bdab9 100644
--- a/weinre.web/modules/weinre/target/WiInspectorImpl.scoop
+++ b/weinre.web/modules/weinre/target/WiInspectorImpl.scoop
@@ -13,8 +13,11 @@
 
 //-----------------------------------------------------------------------------
 method reloadPage(callback)
-    // callback: function()
-    Weinre.notImplemented(arguments.callee.signature)
+    if (callback) {
+        Weinre.WeinreTargetCommands.sendClientCallback(callback)
+    }
+
+    window.location.reload()
 
 //-----------------------------------------------------------------------------
 method highlightDOMNode(/*int*/ nodeId, callback)