Code cleanup

Fixes:
- code structure and idioms to adhere to Python standards
- class constructors and attribute initialization
- exception handling issues (like except:)
- string manipulations
- some explicit for loops were converted to list comprehensions
- pep8 compliance

Change-Id: I90e41fcfa46d7aee67de99c83b19937e24a359d3
Signed-off-by: Martin Sivak <msivak@redhat.com>