Clean merge for PR#59 'Expanded includes'

I tried to merge #59 . Can you please verify if everything is working as expected? I successfully tested it on a small installation, but since it's a rather big merge and I would like to make sure there's no regression.