Further improvements in client.py. Editing works much better now. Solved some tabbing related problems, a few obvious bugs remain