Added connectToServer to app namespace (to remove from global scope).