Created time helper functions

Should not be merged yet.
I think you could just do `(PredicateNode $before_or_after)` here, since `before-or-after-node` seems kind of redundant.  Just nitpicking :)