copyWithinFootprint: more complete fix for respect image size

Had fixed the iteration range previously, but not the iterators, so that
it was still possible for the iterators to start off the image.  Made
things more consistent and clearer with more temporary variables.
Exposure: Add includeValidPolygon option to contains function to check in valid region.
Merge branch 'tickets/HSC-974'
Footprint::clipTo: optimise removal of peaks not in the new bbox

Old implementation was using std::vector::erase in a loop, which is very
inefficient for large size (e.g., when deblending a large chain of
sources).  Instead, use the erase-remove idiom.
Fits Ctor with MemFileManager: don't pre-allocate memory

cfitsio will attempt to read within this memory, which hasn't been
initialised (picked up by valgrind).  There's no need to pre-allocate
it, as cfitsio can allocate it itself, and it will initialise it how
it wants.
unreduceFromFits: allow extra char for nul

Valgrind picked up an invalid write a single byte beyond the limit of the
allocated memory.  It seems we need an extra byte to allow for a nul char.
Merge branch 'tickets/HSC-1004': Segfault in reduceFrames.py
Allow background to persist info about approx
Use shared_ptr.  Add test.  Disable double,int backgrounds.
Check valid shared_ptr before dereferencing
Merge branch 'u/bick/HSC-1051'
Handle BackgroundList properly with approx code (from code review)
Merge branch 'u/bick/HSC-1047'
added explicit instantiations
bugfix: explicitly instantiate detail::SchemaImpl::find(std::string)
A proper fix for #3080

Introduced a new PixelTypeTraits<> templated class to retrieve the padding
value for a pixel type.

Conflicts:
	include/lsst/afw/image/Pixel.h
(a white space change)
FunctionLibrary: instantiate (Double)GaussianFunction2 (DM-288)

The lack of instantiation appears to be causing link problems
on MacOS 10.9 with the latest clang.  It's disconcerting that this
obvious problem didn't appear with other compilers...
Merge remote-tracking branch 'mitaka/tickets/HSC-1078' into mitaka