Added support for :before and :after methods, and added documentation and unit tests for it