Fix T39895: Displaying the armature layers popup in edit mode always fails.

In fact, armature layers operators (set layers, and show all) were kind of messy and broken
in Edit mode (Select layers had two different operators for Pose and Edit modes, both
using the same funcs that could only work in Pose mode, Show All was supposed to be
used in both modes but again, its exec code could only work in Pose one).

Fixed that by:
* Using only one op for each task, for both modes (with adapted poll func).
* Replacing 'object from context' access by an helper that returns the right Armature
object in both Edit and Pose modes.
Always init pointcache frame step to 1.

Note it was already the case for many simulations (cloth, rigidbody, etc.), just doing this
systematically in BKE_ptcache_add() now, will avoid us some recurring bug reports.
Advanced users will know when they can/have to raise this parameter!
Fix for transform local-axis calculation with zero length normals
Outliner: avoid using bitshift when hashing (which could use negative numbers)
Fix T39896: lock view rotation, behavior not consistent
Avoid integer overflow in build_implicit_tree_helper
Cycles: avoid some CUDA performance on scenes without deformation motion blur.
Code cleanup: use 'const' for arrays (blenkernel)
Code cleanup: use 'const' for arrays (blenlib)
Code cleanup: use 'const' for arrays (python)
Code cleanup: use 'const' for arrays (windowmanager)
Code cleanup: use 'const' for arrays (render)
Code cleanup: use 'const' for arrays (editors)
Code cleanup: use 'const' for arrays (bmesh)
Code cleanup: use 'const' for arrays (blenloader, gpu, imbuf, makesdna, modifiers, nodes)