necessary fixes needed to compile BAGEL.

o I assume that begin(T) and end(T) are not implemented in a general enough way. Did not work for derived classes.
o Adding a constructor of RangeNd so that one can do RangeNd(Range1d<T> r, const int n). Useful for users with generic code.