improved source layout

especially indenting and comments
I also added vim modelines (:h modeline)