Negation support

This is a resubmit of PR #95 which adds support for negations.
I've been maintaining the code of that PR in my own branch for quite some time now, not noticing that the pull request had been closed. So now I'm creating another PR for it. However I have updated and rebased onto the current master branch.