Overall code cleanup and coding style adaptations. I hope this now matches the kdelibs guidelines better.