Add templating callback 'beforeAdd'; add callback arg 'isFirstExecution'

I've added this callback 'beforeAdd' to the foreach/templating bindings, so that KO clients can be informed before elements are added to the DOM. This was necessary to make my [Isotope binding for Knockout](https://github.com/aknuds1/knockout-isotope) work properly (Isotope needs to be able to filter elements before they are added to the DOM, otherwise new elements are briefly visible before Isotope hides them).

I've written a corresponding spec for the foreach binding, and verified that all tests pass (by running build.sh, so that tests are run under Node and PhantomJS).