Add support for "before" and "after" (Fixes #3, Followup of #6)

I forgot about the change we agreed on in pull request #6. Sorry for that.

I am unable to update and reopen the old pull request. Hence, I opened this one.