More client implementation.

Client widget refactored, some code tested. Sources reformatted with Qt style.