Fix 'debugnan' feature to not give false positive for arrays and components.

The way the optional "debugnan" feature works is to insert code that,
every time a symbol is written to, checks it for NaN or Inf values.  But
it simply checked ALL the data for that symbol, so if the symbol was an
array or an aggregate (like a color), upon something like a[0] = 0, it
might still issue an error if a[1] (as yet uninitialized) coincidentally
contained the right bits for a NaN. This kind of "false positive" could
interfere with debugging an actual NaN which occurred elsewhere.

So this patch makes the debugnan checks much smarter by having a special
case for 'aassign' (array assignment) and 'compassign' (component
assignment) ops, and in that particular case only checking for NaN/Inf
values in the particular array element or component that was just written.
Runtime constant-fold of cellnoise calls
Simplex noise

This patch implements noise("simplex",...) for OSL. Like the "perlin"
noise, it's aperiodic, ranges on [-1,1] with a large-scale average of
0. There's also "usimplex" which is the unsigned version -- range [0,1]
with an average of 0.5, analogous to our "uperlin". I have NOT
implemented a periodic (pnoise) version of simplex noise; since it's not
a rectangular grid, imposing a rectangular periodicity is a bit trickier
to implement, so I'll hold off on that unless/until there's a
significant demand.

Simplex is similar in character to Perlin noise but has some important
differences:

1. At 2D and higher, the frequency content is a bit higher than Perlin
noise (that is, the waves are steeper and closer together. This is
because the simplex vertices are on average closer together than the
rectilinear grid vertices of Perlin.

2. At 2D, the simplex noise bumps fully blend into each other (as Perlin
does at all octaves), but at 3D a single octave looks a bit more like
separated bumps, and it's very noticeable at 3D. This is all pretty
noticeable with a single octave, but much harder to see when multiple
octaves of noise are used.

3. Also because of the layout of the simplex grid, there is a some
directionality visible in 2D planar slices of the 4D noise. You may find
this objectionable, or maybe for a curved solid object, you won't notice
it at all. Use your best judgment.

Simplex noise is currently about 5% slower than Perlin for 1- and 2-D,
about 10% faster than Perlin for 3D, and over 2x faster than Perlin for
4D noise. So at 3D and especially for 4D (especially the latter), you
may prefer it for performance, if the look is acceptable.

The underlying implementation of the simplex noise is based on public
domain code by Stefan Gustavson, though heavily modified.
Fix shared_ptr ambiguity

Have an OSL::shared_ptr, which is either std::shared_ptr (if C++11) or
boost::shared_ptr (not C++11).

Change all explicit refs to boost::shared_ptr and the occasional
implicit reference to OIIO::shared_ptr, all to OSL::shared_ptr.
Fix pair construction problems with some compilers
Update PDF docs
Simpler formulation for  Dual distance.
Check format/printf/error/warning format string versus argument.
It's an error if it can be detected at compile time.  If not, then
at least do something safe at runtime by substituting the default
format for whatever type is actually passed.
Eliminate random() from the spec; never implemented, not missed.

Augment description of hash() to allow it to hash integers and strings.
update CHANGES
Get rid of TBB references
Allow ConstantSymbol to hold larger constants (like arrays).
This required some refactoring for dynamic storage, before it was hard-coded
to only work with simple fixed-size types.
Allow arrays that are initialized with only constants to generate true
array constants, instead of making code that initializes the array
element-by-element.
Fix missing integer min, max, and clamp declarations
Bug fix in newly-added make_constant variety -- reversed memcmp sense
Cut off huge arrays early for certain debug output
Improved constant folding: max/min for int, cos, sin, acos, asin, normalize
Do not unnecessarily allocate storage and extra copying of array constants.
Constant folding for inversesqrt, exp*, log*, erf*, radians, degrees.
Add make and CMake options USE_EXTERNAL_PUGIXML to use external/system
PugiXML rather than the one from the OIIO distribution.  This is especially
helpful for sites that build OIIO with its USE_EXTERNAL_PUGIXML mode.