Rewrite client application and fix some server / client issues.