UI improvements and Sync fixed

The server now takes commands.
The actual algo is wrapped in synchronized blocks to avoid race conditions.
The concept of "locked" network is introduced.