Cleanups, and simplificaiton of some code.
updated installer secript to auto-remove old variables.
Fixed sycn with realms.
Fixed printing of sync debug messages.
Merge branch 'test' into dev