flatten/flatten_view/ref

New algorithm 'flatten' & view type 'flatten_view', plus support for boost::ref for working with mutable sequence.

Adapted from https://svn.boost.org/trac/boost/ticket/9294