fix Newton's method's convergence checks

There are two convergence criteria implemented in Newton's method, one based
on ||F(x)|| and one based on ||dx||. There used to be a bit of confusion as
to when to check the respective residuals. This led the implementation to
unconditionally solve a linear system even if ||F(x)|| was below tolerance.
This commit fixes this.

Typical output will now be

  Newton iteration 0: r (abs) = 1.045e+02 (tol = 1.000e-10) r (rel) = 1.000e+00 (tol = 0.000e+00)
  Solving linear system of size 25028 x 25028 (PETSc Krylov solver).
  Newton iteration 1: r (abs) = 1.600e+02 (tol = 1.000e-10) r (rel) = 1.532e+00 (tol = 0.000e+00)
  Solving linear system of size 25028 x 25028 (PETSc Krylov solver).
  Newton iteration 2: r (abs) = 3.393e-04 (tol = 1.000e-10) r (rel) = 3.248e-06 (tol = 0.000e+00)
  Solving linear system of size 25028 x 25028 (PETSc Krylov solver).
  Newton iteration 3: r (abs) = 2.276e-10 (tol = 1.000e-10) r (rel) = 2.178e-12 (tol = 0.000e+00)
  Solving linear system of size 25028 x 25028 (PETSc Krylov solver).
  Newton iteration 4: r (abs) = 4.153e-12 (tol = 1.000e-10) r (rel) = 3.976e-14 (tol = 0.000e+00)
  Newton solver finished in 4 iterations and 17 linear solver iterations.
Minor pugixml simplification.
Changes to get the released version of PETSc 3.4.0 to compile
Get compiling with PETSc < 3.4 again. Gah, I hate their
interface changes
More compiling with different PETSc versions
More SNES options.
Move the SNESSetFromOptions down a bit.
More SNESSetFromOptions so that the right options are actually picked up.
Add BLAS libs for PETSc tests on OSX.

Problem is that ResolveCompilerPaths, which builds a list of libaries with the full path, discards the OSX Accelerate framework.
Add missing CMake file.
Fix for PETSc 3.3.
Minir initialisation fix.
Add constructor to create a MeshFunction from MeshDomains.
Add unit test (cpp) for new MeshFunction constructor.
Re-enable a SubMesh unit test.
Merge branch 'garth/xml-cleanup'
Merge branch 'garth/fix-petsc-osx-detection'
Merge branch 'nschloe/newton-msg'
Merge branch 'garth/new-meshfunction-constructor'
Merge branch 'pefarrell/snes-petsc-3.4'