Start messageserver. Fix dialogs.
Set environment variables.
First working implementation of sync.