Allow the use of a counter in the views

The current variable counter is broken if some of the partials are cached and others are not in a collection, hence I have created a new magic variable called:

cache_safe_#{variable}_counter

where #{variable} is the name of the collection variable e.g. product -> cache_safe_product_counter

Also included are specs