Fix T41601: Correlated multi-jitter with high samples "hangs"

Issue was caused by the precision issues which made sdivm by 1 under
it's actual value. We can try to do some eps magic, but from the tests
on laptop and desktop doing integer division is not slower than using
floats here.
Fix T41604: Double updates of world and material texture settings

The issue was caused by the world localization setting the ID_WORLD
type update tag. Now using a function which doesn't pollute the library
and which doesn't set update flags.
Bake-API: silencing warnings (and fixing a potential memory-access crash)
Add debug information for maximum opengl limits in system info
generation.
Fix T41602: Camera draw size ignores scene scale
Fix T41473: Cycles volume rendering is too dark

The issue was caused by the changed defaults from the Cycles side.
Because of those properties being saved as an IDProp and not being
saved to the file, every change to the defaults would ruin someone's
day updating the values.

Added a bpy.app.handler.version_update which is run after the regular
do_versions() are done and could be sued by the scripts to apply
versioning code on their settings.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D761
Followup for the previous commit: apparently for CMake py files are hardcoded
Texture paint system:

* Add ability to choose blend type and enable/disable toggle for each
slot for blender internal.
Texture painting:

Include explicit control for texturing:

This commit introduces a painting mode option, available in
the slots panel. The default value "Material"  will create slots from the
blender material, same as just merged from the paint branch.

The new option "Image", will use an explicit image field that artists can use
to select the image to paint on. This will should allow painting regardless
of the renderer used or for use in modifiers.
Fix another part of the issue T41604

Missed that part of the report somehow, thought it's all about world..
Fix some crash cases after last commit
Solve another case of invalid indices.
Fix Text editor home/end keys when theres a selection
Cleanup
Remove redundant casts
Add callback for starting a render-job

We had complete/cancel, but no matching init for rendering,
render_pre/post callbacks aren't always usable.
Fix T41617: Color ramp crashes user preferences

Color ramps with no handles caused issues.
Cycles: Fix triangle ribbons hair in viewport and ortho camera

There were several issues involved into triangle ribbons hair:

- Even for the viewport rendering the blender scene camera was
  used for orientation. This made hair triangles oriented to
  the scene camera, not to the viewport camera.

- Triangle orientation was actually supposing the camera is
  perspective. Triangles weren't oriented properly for the
  orthographic camera resulting in different hair width across
  it's length.

This issues are solved now, but there are some related TODOs:

- Rotating viewport doesn't re-orient the triangles, so after
  viewport navigation hair might not look correct. However,
  with this fix toggling viewport render (to force hair sync)
  makes viewport render correct.

  This isn't so much trivial fix, would require making BVH
  aware of the dynamic triangle orientation, so they get
  properly oriented without full hair re-sync.

- Panorama camera behavior didn't change but looks like it
  should, however not really sure atm what's the right thing
  to do here.
Fix for blender.exe -r being registering blender-app.exe
Fix T41631: Connect acts on unrelated vert