Add onBegin and onEnd callbacks
Merge pull request #22 from teddyzeenny/loop-callbacks

Add beforeLoop and afterLoop callbacks