implemented .before() and .after() methods

Closes #12 and #13