Add changes from @activitree fork.
There were lots of style changes so I tried to distill them to the absolute minimum.
cc @StorytellerCZ @jankapunkt