Freestyle: Built-in SVG exporter.

Features:
* Both still image and animation rendering, as well as polygon
  fills are supported.
* The exporter creates a new SVG layer for every Freestyle line
  set. The different layers are correctly sorted.
* SVG paths use data from line styles, so the base color of a
  line style becomes the color of paths, idem for dashes and
  stroke thickness.
* Strokes can be split at invisible parts.  This functionality is
  useful when exporting for instance dashed lines or line styles
  with a Blue Print shader
* The exporter can be used not only in the Parameter Editor mode,
  but also from within style modules written for the Python
  Scripting mode.

Acknowledgements:
The author would like to thank Francesco Fantoni and Jarno
Leppänen for their [[ https://github.com/hvfrancesco/freestylesvg | Freestyle SVG exporter ]].

Differential revision: https://developer.blender.org/D785

Author: flokkievids (Folkert de Vries)

Reviewed by: kjym3 (Tamito Kajiyama)
Fix T42281, crash in subsurf with texture painting.
Fix for rB61a330baca0f: Changed SVG file encoding from UTF-16 to UTF-8.
Freestyle: rename module to export_svg

Convention for existing export modules
Freestyle: add GPL headers
Cleanup: pep8
Cleanup: unused import
Freestyle: lazy load 'export_svg'

Loading XML module, registering etree namespaces... etc
on startup for everyone on chance someone may want to export
an SVG from Freestyle is unacceptable.

This shouldn't have got through the review.

also disable loading when built without freestyle.
Reports: include parent library in readfile report

Helps troubleshooting indirect links.
Revert "Freestyle: lazy load 'export_svg'"

This reverts commit c35a649a0a6c3c07bb8d56caba680887f726b9e9.
Revert "Cleanup: unused import"

This reverts commit fc7752b53c793a6985525d4c099108a97cd7867e.
Revert "Cleanup: pep8"

This reverts commit 06cdc35a68d9a0bd2a84fd92bda2be11318d46ff.
Revert "Freestyle: add GPL headers"

This reverts commit 3cbb066b838b4d52673f3fd76c2f695a3491b8b6.
Revert "Freestyle: rename module to export_svg"

This reverts commit db249b787fe0875944e00df1a3d12a58d9a07249.
Revert "Fix for rB61a330baca0f: Changed SVG file encoding from UTF-16 to UTF-8."

This reverts commit 490f2aeb8247463a7ea1a86a3a8c4246fcf45f23.
Revert "Freestyle: Built-in SVG exporter."

This reverts commit 61a330baca0ff9bb3cf477c04f539ef276a0356f.

This completes reverting D785

This feature is to be reworked into an addon.
Fix typo in calculateCenterMedian that could give computed median point wrong values.

From soc-2014-shapekey branch, with minor edits by mont29 (Bastien Montagne).
Fix T42303 Icons lost after loading window

The issue here is that if no matching winid is found, we destroy all
windows and their context with them. This will also delete the OpenGL
textures associated with the initial context, thus we lose the icons.
This patch makes sure a window is always kept for later so the initial
context does not get lost.

Thanks to Campbell and Ton for the discussion on the issue.
Fix T42304: blender 2.72a 3D view object selected color wrong in 2.4x theme.

I would not have endured such a critical and monstruous bug one more femtosecond!

And even worse - active color was awfully wrong too! Shocking!
Fix T42264: Negative scale & clipped-select fails

Thanks to mont29 for finding the cause.