Fix occasional wrong normal for curves with minimum width.

This caused a couple of fireflies in koro_final.blend. The wrong normal would
cause the shading point to be set as backfacing, which triggered another bug
with hair BSDFs on the backface of hair curves. That one is not fixed yet but
there's a comment in the code about it now.
Cycles: some tiny hair intersection optimizations that help maybe 2%.
Fix T39458: Switching physics type from Character to Dynamic enables ghost flag silently

Enabling ghost for Sensors and Characters is now done in conversion
rather than when setting the RNA.
BGE Cleanup: Removing KX_ObjectProperties, KX_BoundBoxClass, KX_BoxBounds, and KX_CBounds

These were used in BL_CreatePhysicsObjectNew() in the converter. However, all
of the data put into KX_ObjectProperties was then copied again in
KX_ConvertBulletObject(). So, instead KX_ConvertBulletObject() now gathers the
information it needs itself, which avoid this odd double conversion step for
physics.

As a side-effect, the old code would result in static non-mesh objects with no bounds
set to still have triangle mesh bounds. This would result in no bounds for these objects.
If a bounds was set that required a mesh, non-mesh objects would become sphere bounds.
This is now true regardless of whether user bounds were set. In other words, static
non-mesh objects now use sphere bounds by default instead of mesh bounds. This might
slightly alter some games, but these objects should generally be set to No Collision
anyways.
BGE Cleanup: Removing all of the my_* functions in KX_ConvertPhysicsObjects.cpp that were used to get bounds information

Now we just use BKE_object_boundbox_get().
Fix T39850: Graph Editor - 'Mirror Over First Selected Marker' mirrors over frame 0 instead

Problem was introduced back in 2.70 during Project Pampa when the FCurve Normalisation
feature was introduced. The cause was that the normalised cursor value was always getting
passed to the KeyframeEditData context, even when it wasn't needed.
Applying same fix for snapping keyframes in Graph Editor
Whitespace
Added missing bpy.data.linestyles.is_updated property.

Reference: http://wiki.blender.org/index.php/Dev:2.6/Source/Render/UpdateAPI
Blender Internal: Add material property "Cast" which can disable both ray and buffer shadows.

Also refactor:
- Material property UI related to shadows
- Preparation of OR-ed mode flags (ma->mode_l) of render materials

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D313
Quiet warning
Fix T39847: uiPreview not being copied with areas
Code cleanup: style and use switch () for (un)pack
Libmv cleanup: move aligned malloc implementation into own file

It was rather stupid having it in brute region tracker,
now it is in own file in base library.
Fix T39849: Adding links directly between node group input/output
extension sockets would create additional extension sockets instead of
simply ignoring them.
Cleanup in modifier stack evaluation: deduplicate final tessellation handling code between
editmode and objectmode functions. No behavioral change expected!
Update ffmpeg in install_deps.sh to 2.1.4.
Fix compilation on OSX after previous commit

EXPECT_EQ wasn't defined in the scope.
Fix T39781: Autosmooth feature: erroneously showing hidden vertices' normals too when in "vertex per face" display

So, turned out after all we need a foreachmapped helper for loops as well... :/

CDDM and EBDM were reasonably simple, but I fought hours with CCGDM (subsurf) to find only a
bad working solution (see D478). So I fallback to a code similar to CDDM one.
Probably not nice for performances, but loops and subsurf are not matching well...

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D478
Fix T39828: Incorrect render layer visibility display for animated render layers.

More like a workaround, current depsgraph does not really allow for animated layers,
esp. when we alwys expect at least one to be enabled (same issue as with basic Scene layers).