Some refactoring
More warning elimination
Moved syncing to thread and open status window
Removed debugging function