Cycles: less instructions for CPU perlin code

Also move shuffle() in bvh traversal back (was accidentally lost in SSE hair revert)
Fix T38432, Fix 38432: more stupid error in view3d ray code, sorry about that.
Math lib: add axis_angle_normalized_to_quat, use when length is known
Math lib: simplify size_to_mat4 and use in b_bone_spline_setup
Code cleanup: use length squared where possible
Smallhash: optimizations

- remove static array used only for copying (use alloca on resize)
- set SMSTACKSIZE to one of the values in 'hashsizes' since the full available size was never used.
- ensure ~1.5x as many buckets as entries, was 3x which caused malloc's quite early on.
Smallhash: fixes/improvements

- use magic numbers based on uintptr max, not uint max, to avoid possible collisions with real pointer values on 64bit systems.
- comment BLI_smallhash_remove for now, its not used.
- added smallhash_val_is_used replacing ELEM() checks
- updated docs
Smallhash: add reserve option to avoid resizing when size is known
BMesh: optimize lookups for triangle fill
BMesh: optimize loop_find_regions, reserve array size
Add include needed for clang, quiet warning
Imported D222 Diff 2 (ID 781) by flokkievids (Folkert de Vries).
Fix for iterators' at_start flag left unset in C++ to Python conversion utility functions.
Also changed the type of the 'reversed' flag from int to bool.
Code cleanup (mostly indentation and white space).
Docstring updates and code cleanup by flokkievids (Folkert de Vries).
Freestyle: Fix for iterations over 0D elements in the reversed order.

The revision is concerned with Interface0DIterator and StrokeVertexIterator.
These iterators can be generated by Interface1D::vertices_end() and
Stroke::stroke_vertices_end(), respectively.  These methods return an
iterator poinitng the next index of the last 0D element (i.e., iterator's is_end
property is true).  When the iterators created in this way are used with
Python's iterator protocol (e.g., in a for-loop), iterations over 0D elements
are automatically performed in the reversed order.  This functionality was
broken after recent revisions concerning Freestyle iterators.

Also made minor code cleanup (white space).
Fix: Compile error due to missing #define for MSVC9 (VisualC++ 2008)

Added some relevant #defines copied from extern\libmv\third_party\msinttypes to BLI_sys_types.h so they can be used in blenlib. Made smallhash.c use the BLI_sys_types.h include rather than including <stdint.h> directly
Code cleanup: suffix vars to make obvious they are squared
Update Object Mode Toolbar Tabs

This updates the object mode toolbar tabs to reflect the rationale from the Edit Mode tabs.
- Rename "Basic" to "Tools"
- Put "Transform" into it's own panel within Tools
- Also rename Edit Mode "Mesh Tools" to "Tools" for consistency and shorter names
- Ensure Tools tabs are in same location between Edit and Object modes
- Remove redundant "Transform" label from Transform panel
Update tabs for non-mesh object types

This adds appropriate tabs, panels, etc for curves, surfaces, metaballs, text, and armatures. This brings it in line with the changes in rB0972c422c3ac4ed725414baa47838f833b3f4c90