diff --git a/ChronoSync b/ChronoSync
index d95c231..5eb1cb5 160000
--- a/ChronoSync
+++ b/ChronoSync
@@ -1 +1 @@
-Subproject commit d95c2312e02732e182897170b17ae08fd2859f54
+Subproject commit 5eb1cb5a5f161b048663ac4cede7f221d63162cd
diff --git a/contrib/osxdist-10.7.py b/contrib/osxdist-10.7.py
index 6e7cf8d..db91474 100755
--- a/contrib/osxdist-10.7.py
+++ b/contrib/osxdist-10.7.py
@@ -34,7 +34,7 @@
   if hasattr(path, 'isalpha'):
     path = (path,)
   for p in path:
-    p = Popen(('codesign', '--keychain', options.codesign_keychain, '--signature-size', '6400', '-vvvv', '-s', options.codesign, p))
+    p = Popen(('codesign', '-vvvv', '--deep', '--force', '--sign', options.codesign, p))
     retval = p.wait()
     if retval != 0:
       return retval
@@ -62,6 +62,8 @@
       return True
     if lib.startswith('/usr/lib/'):
       return True
+    if lib.startswith('/usr/local/ndn/lib/'):
+      return True
 
     return False
 
@@ -177,6 +179,20 @@
             os.system('install_name_tool -id @executable_path/../Frameworks/%s %s' % (rel, abs))
             self.handled_libs[basename] = True
             self.handle_binary_libs(abs)
+            
+            try:
+              f=open("%s/Resources/Info.plist" % dst, 'w')
+              w.write('''<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+</dict>
+</plist>''')
+            except:
+              pass
+
         os.chmod(macho, 0755)
         os.system('install_name_tool -change %s @executable_path/../Frameworks/%s %s' % (lib, rel, macho))
 
@@ -348,7 +364,6 @@
   parser.add_option('-s', '--snapshot', dest='snapshot', help='Build a snapshot release. This determines the \'snapshot version\'.')
   parser.add_option('-g', '--git', dest='git', help='Build a snapshot release. Use the git revision number as the \'snapshot version\'.', action='store_true', default=False)
   parser.add_option('--codesign', dest='codesign', help='Identity to use for code signing. (If not set, no code signing will occur)')
-  parser.add_option('--codesign-keychain', dest='codesign_keychain', help='The keychain to use when invoking the codesign utility.')
 
   options, args = parser.parse_args()
 
@@ -379,7 +394,7 @@
   if options.codesign:
     print ' * Signing binaries with identity `%s\'' % options.codesign
     binaries = (
-      'build/ChronoChat.app',
+      'build/%s/ChronoChat.app' % BINARY_POSTFIX,
     )
 
     codesign(binaries)
diff --git a/contrib/osxdist-10.8.py b/contrib/osxdist-10.8.py
index 5f1757b..a777278 100755
--- a/contrib/osxdist-10.8.py
+++ b/contrib/osxdist-10.8.py
@@ -34,7 +34,7 @@
   if hasattr(path, 'isalpha'):
     path = (path,)
   for p in path:
-    p = Popen(('codesign', '--keychain', options.codesign_keychain, '--signature-size', '6400', '-vvvv', '-s', options.codesign, p))
+    p = Popen(('codesign', '-vvvv', '--deep', '--force', '--sign', options.codesign, p))
     retval = p.wait()
     if retval != 0:
       return retval
@@ -62,6 +62,8 @@
       return True
     if lib.startswith('/usr/lib/'):
       return True
+    if lib.startswith('/usr/local/ndn/lib/'):
+      return True
 
     return False
 
@@ -177,6 +179,20 @@
             os.system('install_name_tool -id @executable_path/../Frameworks/%s %s' % (rel, abs))
             self.handled_libs[basename] = True
             self.handle_binary_libs(abs)
+            
+            try:
+              f=open("%s/Resources/Info.plist" % dst, 'w')
+              w.write('''<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+</dict>
+</plist>''')
+            except:
+              pass
+
         os.chmod(macho, 0755)
         os.system('install_name_tool -change %s @executable_path/../Frameworks/%s %s' % (lib, rel, macho))
 
@@ -348,7 +364,6 @@
   parser.add_option('-s', '--snapshot', dest='snapshot', help='Build a snapshot release. This determines the \'snapshot version\'.')
   parser.add_option('-g', '--git', dest='git', help='Build a snapshot release. Use the git revision number as the \'snapshot version\'.', action='store_true', default=False)
   parser.add_option('--codesign', dest='codesign', help='Identity to use for code signing. (If not set, no code signing will occur)')
-  parser.add_option('--codesign-keychain', dest='codesign_keychain', help='The keychain to use when invoking the codesign utility.')
 
   options, args = parser.parse_args()
 
@@ -379,7 +394,7 @@
   if options.codesign:
     print ' * Signing binaries with identity `%s\'' % options.codesign
     binaries = (
-      'build/ChronoChat.app',
+      'build/%s/ChronoChat.app' % BINARY_POSTFIX,
     )
 
     codesign(binaries)
diff --git a/contrib/osxdist-10.9.py b/contrib/osxdist-10.9.py
new file mode 100755
index 0000000..5ce43fe
--- /dev/null
+++ b/contrib/osxdist-10.9.py
@@ -0,0 +1,412 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+#
+# Loosely based on original bash-version by Sebastian Schlingmann (based, again, on a OSX application bundler
+# by Thomas Keller).
+#
+
+import sys, os, string, re, shutil, plistlib, tempfile, exceptions, datetime, tarfile
+from subprocess import Popen, PIPE
+from optparse import OptionParser
+
+import platform
+
+if platform.system () != 'Darwin':
+  print "This script is indended to be run only on OSX platform"
+  exit (1)
+
+SUPPORTED_VERSION = "10.9"
+BINARY_POSTFIX = "Mavericks-10.9"
+
+if '.'.join (platform.mac_ver()[0].split('.')[0:2]) != SUPPORTED_VERSION:
+  print "This script is indended to be run only on OSX %s platform" % SUPPORTED_VERSION
+  exit (1)
+
+options = None
+
+def gitrev():
+  return os.popen('git describe').read()[:-1]
+
+def codesign(path):
+  '''Call the codesign executable.'''
+
+  if hasattr(path, 'isalpha'):
+    path = (path,)
+
+  for p in path:
+    p = Popen(('codesign', '-vvvv', '--deep', '--force', '--sign', options.codesign, p))
+    retval = p.wait()
+    if retval != 0:
+      return retval
+  return 0
+
+class AppBundle(object):
+
+  def __init__(self, bundle, version, binary):
+    shutil.copytree (src = binary, dst = bundle, symlinks = True)
+
+    self.framework_path = ''
+    self.handled_libs = {}
+    self.bundle = bundle
+    self.version = version
+    self.infopath = os.path.join(os.path.abspath(bundle), 'Contents', 'Info.plist')
+    self.infoplist = plistlib.readPlist(self.infopath)
+    self.binary = os.path.join(os.path.abspath(bundle), 'Contents', 'MacOS', self.infoplist['CFBundleExecutable'])
+    print ' * Preparing AppBundle'
+
+  def is_system_lib(self, lib):
+    '''
+      Is the library a system library, meaning that we should not include it in our bundle?
+    '''
+    if lib.startswith('/System/Library/'):
+      return True
+    if lib.startswith('/usr/lib/'):
+      return True
+    if lib.startswith('/usr/local/ndn/lib/'):
+      return True
+
+    return False
+
+  def is_dylib(self, lib):
+    '''
+      Is the library a dylib?
+    '''
+    return lib.endswith('.dylib')
+
+  def get_framework_base(self, fw):
+    '''
+      Extracts the base .framework bundle path from a library in an abitrary place in a framework.
+    '''
+    paths = fw.split('/')
+    for i, str in enumerate(paths):
+      if str.endswith('.framework'):
+        return '/'.join(paths[:i+1])
+    return None
+
+  def is_framework(self, lib):
+    '''
+      Is the library a framework?
+    '''
+    return bool(self.get_framework_base(lib))
+
+  def get_binary_libs(self, path):
+    '''
+      Get a list of libraries that we depend on.
+    '''
+    m = re.compile('^\t(.*)\ \(.*$')
+    libs = Popen(['otool', '-L', path], stdout=PIPE).communicate()[0]
+    libs = string.split(libs, '\n')
+    ret = []
+    bn = os.path.basename(path)
+    for line in libs:
+      g = m.match(line)
+      if g is not None:
+        lib = g.groups()[0]
+        if lib != bn:
+          ret.append(lib)
+    return ret
+
+  def handle_libs(self):
+    '''
+      Copy non-system libraries that we depend on into our bundle, and fix linker
+      paths so they are relative to our bundle.
+    '''
+    print ' * Taking care of libraries'
+
+    # Does our fwpath exist?
+    fwpath = os.path.join(os.path.abspath(self.bundle), 'Contents', 'Frameworks')
+    if not os.path.exists(fwpath):
+      os.mkdir(fwpath)
+
+    self.handle_binary_libs()
+
+    #actd = os.path.join(os.path.abspath(self.bundle), 'Contents', 'MacOS', 'actd')
+    #if os.path.exists(actd):
+    #  self.handle_binary_libs(actd)
+
+  def handle_binary_libs(self, macho=None):
+    '''
+      Fix up dylib depends for a specific binary.
+    '''
+    print "macho is ", macho
+    # Does our fwpath exist already? If not, create it.
+    if not self.framework_path:
+      self.framework_path = self.bundle + '/Contents/Frameworks'
+      if not os.path.exists(self.framework_path):
+        os.mkdir(self.framework_path)
+      else:
+        shutil.rmtree(self.framework_path)
+        os.mkdir(self.framework_path)
+
+    # If we weren't explicitly told which binary to operate on, pick the
+    # bundle's default executable from its property list.
+    if macho is None:
+      macho = os.path.abspath(self.binary)
+    else:
+      macho = os.path.abspath(macho)
+
+    libs = self.get_binary_libs(macho)
+
+    for lib in libs:
+
+      # Skip system libraries
+      if self.is_system_lib(lib):
+        continue
+
+      # Frameworks are 'special'.
+      if self.is_framework(lib):
+        fw_path = self.get_framework_base(lib)
+        basename = os.path.basename(fw_path)
+        name = basename.split('.framework')[0]
+        rel = basename + '/' + name
+
+        abs = self.framework_path + '/' + rel
+
+        if not basename in self.handled_libs:
+          dst = self.framework_path + '/' + basename
+          shutil.copytree(fw_path, dst, symlinks=True)
+          if name.startswith('Qt'):
+            try:
+              os.remove(dst + '/Headers')
+              os.remove(dst + '/' + name + '.prl')
+              os.remove(dst + '/' + name + '_debug')
+              os.remove(dst + '/' + name + '_debug.prl')
+              shutil.rmtree(dst + '/Versions/4/Headers')
+              os.remove(dst + '/Versions/4/' + name + '_debug')
+            except OSError:
+              pass
+            os.chmod(abs, 0755)
+            os.system('install_name_tool -id @executable_path/../Frameworks/%s %s' % (rel, abs))
+            self.handled_libs[basename] = True
+            self.handle_binary_libs(abs)
+
+            try:
+              f=open("%s/Resources/Info.plist" % dst, 'w')
+              w.write('''<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+</dict>
+</plist>''')
+            except:
+              pass
+            
+        os.chmod(macho, 0755)
+        os.system('install_name_tool -change %s @executable_path/../Frameworks/%s %s' % (lib, rel, macho))
+
+      # Regular dylibs
+      else:
+        basename = os.path.basename(lib)
+        rel = basename
+
+        if not basename in self.handled_libs:
+          print lib
+          print self.framework_path + '/' + basename
+          try:
+            shutil.copy(lib, self.framework_path  + '/' + basename)
+          except IOError:
+            print "IOError!" + self.framework_path + '/' + basename + "does not exist\n"
+            continue
+            
+          abs = self.framework_path + '/' + rel
+          os.chmod(abs, 0755)
+          os.system('install_name_tool -id @executable_path/../Frameworks/%s %s' % (rel, abs))
+          self.handled_libs[basename] = True
+          self.handle_binary_libs(abs)
+        os.chmod(macho, 0755)
+        os.system('install_name_tool -change %s @executable_path/../Frameworks/%s %s' % (lib, rel, macho))
+
+  def copy_resources(self, rsrcs):
+    '''
+      Copy needed resources into our bundle.
+    '''
+    print ' * Copying needed resources'
+    rsrcpath = os.path.join(self.bundle, 'Contents', 'Resources')
+    if not os.path.exists(rsrcpath):
+      os.mkdir(rsrcpath)
+
+    # Copy resources already in the bundle
+    for rsrc in rsrcs:
+      b = os.path.basename(rsrc)
+      if os.path.isdir(rsrc):
+                          shutil.copytree(rsrc, os.path.join(rsrcpath, b), symlinks=True)
+      elif os.path.isfile(rsrc):
+        shutil.copy(rsrc, os.path.join(rsrcpath, b))
+
+    return
+
+  def copy_qt_plugins(self):
+    '''
+      Copy over any needed Qt plugins.
+    '''
+
+    print ' * Copying Qt and preparing plugins'
+
+    src = os.popen('qmake -query QT_INSTALL_PLUGINS').read().strip()
+    dst = os.path.join(self.bundle, 'Contents', 'QtPlugins')
+    shutil.copytree(src, dst, symlinks=False)
+
+    top = dst
+    files = {}
+
+    def cb(arg, dirname, fnames):
+      if dirname == top:
+        return
+      files[os.path.basename(dirname)] = fnames
+
+    os.path.walk(top, cb, None)
+
+    exclude = ( 'phonon_backend', 'designer', 'script' )
+
+    for dir, files in files.items():
+      absdir = dst + '/' + dir
+      if dir in exclude:
+        shutil.rmtree(absdir)
+        continue
+      for file in files:
+        abs = absdir + '/' + file
+        if file.endswith('_debug.dylib'):
+          os.remove(abs)
+        else:
+          os.system('install_name_tool -id %s %s' % (file, abs))
+          self.handle_binary_libs(abs)
+
+  def set_min_macosx_version(self, version):
+    '''
+      Set the minimum version of Mac OS X version that this App will run on.
+    '''
+    print ' * Setting minimum Mac OS X version to: %s' % (version)
+    self.infoplist['LSMinimumSystemVersion'] = version
+
+  def done(self):
+    plistlib.writePlist(self.infoplist, self.infopath)
+    print ' * Done!'
+    print ''
+
+class FolderObject(object):
+  class Exception(exceptions.Exception):
+    pass
+
+  def __init__(self):
+    self.tmp = tempfile.mkdtemp()
+
+  def copy(self, src, dst='/'):
+    '''
+      Copy a file or directory into foler
+    '''
+    asrc = os.path.abspath(src)
+
+    if dst[0] != '/':
+      raise self.Exception
+
+    # Determine destination
+    if dst[-1] == '/':
+      adst = os.path.abspath(self.tmp + '/' + dst + os.path.basename(src))
+    else:
+      adst = os.path.abspath(self.tmp + '/' + dst)
+
+    if os.path.isdir(asrc):
+      print ' * Copying directory: %s' % os.path.basename(asrc)
+      shutil.copytree(asrc, adst, symlinks=True)
+    elif os.path.isfile(asrc):
+      print ' * Copying file: %s' % os.path.basename(asrc)
+      shutil.copy(asrc, adst)
+
+  def symlink(self, src, dst):
+    '''
+      Create a symlink inside the folder
+    '''
+    asrc = os.path.abspath(src)
+    adst = self.tmp + '/' + dst
+    print " * Creating symlink %s" % os.path.basename(asrc)
+    os.symlink(asrc, adst)
+
+  def mkdir(self, name):
+    '''
+      Create a directory inside the folder.
+    '''
+    print ' * Creating directory %s' % os.path.basename(name)
+    adst = self.tmp + '/' + name
+    os.makedirs(adst)
+
+class DiskImage(FolderObject):
+  
+  def __init__(self, filename, volname):
+    FolderObject.__init__(self)
+    print ' * Preparing to create diskimage'
+    self.filename = filename
+    self.volname = volname
+
+  def create(self):
+    '''
+      Create the disk image
+    '''
+    print ' * Creating disk image. Please wait...'
+    if os.path.exists(self.filename):
+      shutil.rmtree(self.filename)
+    p = Popen(['hdiutil', 'create',
+              '-srcfolder', self.tmp,
+              '-format', 'UDBZ',
+              '-volname', self.volname,
+              self.filename])
+      
+    retval = p.wait()
+    print ' * Removing temporary directory.'
+    shutil.rmtree(self.tmp)
+    print ' * Done!'
+
+
+if __name__ == '__main__':
+  parser = OptionParser()
+  parser.add_option('-r', '--release', dest='release', help='Build a release. This determines the version number of the release.')
+  parser.add_option('-s', '--snapshot', dest='snapshot', help='Build a snapshot release. This determines the \'snapshot version\'.')
+  parser.add_option('-g', '--git', dest='git', help='Build a snapshot release. Use the git revision number as the \'snapshot version\'.', action='store_true', default=False)
+  parser.add_option('--codesign', dest='codesign', help='Identity to use for code signing. (If not set, no code signing will occur)')
+  # parser.add_option('--codesign-keychain', dest='codesign_keychain', help='The keychain to use when invoking the codesign utility.')
+
+  options, args = parser.parse_args()
+
+  # Release
+  if options.release:
+    ver = options.release
+  # Snapshot
+  elif options.snapshot or options.git:
+    if not options.git:
+      ver = options.snapshot
+    else:
+      ver = gitrev()  
+  else:
+    print 'ERROR: Neither snapshot or release selected. Bailing.'
+    parser.print_help ()
+    sys.exit(1)
+
+
+  # Do the finishing touches to our Application bundle before release
+  a = AppBundle('build/%s/ChronoChat.app' % (BINARY_POSTFIX), ver, 'build/ChronoChat.app')
+  a.copy_qt_plugins()
+  a.handle_libs()
+  a.copy_resources(['qt.conf'])
+  a.set_min_macosx_version('%s.0' % SUPPORTED_VERSION)
+  a.done()
+
+  # Sign our binaries, etc.
+  if options.codesign:
+    print ' * Signing binaries with identity `%s\'' % options.codesign
+    binaries = (
+      'build/%s/ChronoChat.app' % (BINARY_POSTFIX),
+    )
+
+    codesign(binaries)
+    print ''
+
+  # Create diskimage
+  title = "ChronoChat-%s-%s" % (ver, BINARY_POSTFIX)
+  fn = "build/%s.dmg" % title
+  d = DiskImage(fn, title)
+  d.symlink('/Applications', '/Applications')
+  d.copy('build/%s/ChronoChat.app' % BINARY_POSTFIX, '/ChronoChat.app')
+  d.create()
+
diff --git a/src/contactpanel.ui b/src/contactpanel.ui
index 44e4250..b79ef5d 100644
--- a/src/contactpanel.ui
+++ b/src/contactpanel.ui
@@ -20,7 +20,7 @@
    </sizepolicy>
   </property>
   <property name="windowTitle">
-   <string>Contacts</string>
+   <string>ChronoChat Contacts</string>
   </property>
   <widget class="QWidget" name="layoutWidget">
    <property name="geometry">
diff --git a/wscript b/wscript
index 1cfb1ce..0443381 100644
--- a/wscript
+++ b/wscript
@@ -1,12 +1,12 @@
 # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-VERSION='1.0'
+VERSION='0.4'
 APPNAME='ChronoChat'
 
 from waflib import Configure, Utils
 
 def options(opt):
     opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
-    opt.add_option('--no-log4cxx',action='store_false',default=True,dest='log4cxx',help='''Disable log4cxx''')
+    opt.add_option('--log4cxx',action='store_true',default=False,dest='log4cxx',help='''Enable log4cxx''')
     
     opt.load('compiler_c compiler_cxx boost protoc qt4')
 
@@ -30,7 +30,6 @@
     else:
         conf.add_supported_cxxflags (cxxflags = ['-O3', '-g', '-Wno-tautological-compare', '-Wno-unused-function'])
         
-    # conf.check_tinyxml(path=conf.options.tinyxml_dir)
     conf.check_cfg(package='libndn.cxx', args=['--cflags', '--libs'], uselib_store='NDNCXX', mandatory=True)
     conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
     if conf.options.log4cxx:
@@ -49,7 +48,7 @@
         defines = "WAF",
         source = bld.path.ant_glob(['src/*.cpp', 'src/*.ui', '*.qrc', 'logging.cc', 'src/*.proto']),
         includes = "src .",
-        use = "QTCORE QTGUI QTSQL SQLITE3 NDNCXX BOOST BOOST_FILESYSTEM LOG4CXX CRYPTOPP SYNC",
+        use = "QTCORE QTGUI QTWIDGETS QTSQL SQLITE3 NDNCXX BOOST BOOST_FILESYSTEM LOG4CXX CRYPTOPP SYNC",
         )
 
     # if bld.env['DEBUG']:
