added $index value in the binding context of foreach templates.
forgot this function also requires the index.
new test, this one makes sure that the indices update as the relevant nodes move around.
first guess at how to support modifying observable indices.
comments.
we need to create the new indices by tracking added and retained nodes, using i is insufficient.
finally cracked it. the problem was duplicate context creation.

it is also necessary to perform double buffering of the stored contexts such
that we do not overwrite new nodes or move new nodes by mistake.
Merge branch 'master' into foreach-context-index

* master:
  More indentation tweaks for tidiness
  Update the build
  Minor indentation tweaks
  Stylistic tweaks to previous commit
  Eliminate redundant IE6/7 workarounds for radio/checkbox issues. These problems no longer apply now that bindings are always applied to elements after they've been put into the DOM. Fixes issue #169
  Refactor bad code
  minor fix
  Fix render array with \"undefined\" and \"null\" items in \"foreach\"  template
  Updated remove and removeAll to modify their underlying arrays rather than creating new arrays. This makes them consistent with the rest of the array write functions. Added tests to verify original array is modified. Also added test to verify there is no notification when nothing is removed.
  changing IE detection to not rely on user agents
  Fixed a variable which should not have been global.
Merge branch 'master' into foreach-context-index

Conflicts:
	spec/templatingBehaviors.js
	src/binding/editDetection/arrayToDomNodeChildren.js
	src/templating/templating.js
Merge branch 'master' into foreach-context-index
Merge barkmadley:foreach-context-index into 182-foreach-index

Conflicts:
	spec/templatingBehaviors.js
	src/templating/templating.js
Continuation of #182 - Simplify by having setDomNodeChildrenFromArrayMapping manage the observable index.
foreach $index: fix spec that failed in IE; help performance a bit

renderTemplateForEach now assumes that setDomNodeChildrenFromArrayMapping will call the mapping callback and then the afterAdding callback once for each new or changed item. Modify specs to verify this behavior.
Extend the specs for setDomNodeChildrenFromArrayMapping to include replacing a value through an observable item.
#260 - Have build scripts report on files with trailing spaces
Ko missing in spec
applyBindingsToDescendants called with extra parameter
#361 - bindingContext.extend uses clone instead of child context
Merge pull request #386 from GilesBradshaw/MinorSpecFix

applyBindingsToDescendants called with extra parameter in spec
#387 - prevent recursive evaluation of computed observables