Bake-API: allow custom UV to be baked

Note: the custom UV option is only available when calling the operator
via a script. It's currently not exposed in the UI since it's intended
to be used by scripters

To test it:
bpy.ops.object.bake(type='UV', use_clear=True, uv_layer='MyNewUV')

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D546
Disable cubins for OSX buildbot

This is a temporary solution in order to get at least
rest of the blender begin up-to-date on the buildbot.

To be able to compile cubins again we need to switch
OSX builder machine to OSX 10.8 and CUDA toolkit 6,
which might take some time, unfortunately.
Fix memory leaks in subsurf
Correct casts for IS_EQ and other macro tweaks
- ensure GET_INT_FROM_POINTER us only used to get values
- rename STACK_POP_ELSE -> STACK_POP_DEFAULT
Fix for weak floating-point number comparison.

Was causing assertion failures in MinGW-w64.
Transform: PET only treat faces as connected diagonally across quads

Was an intentional change, but worse for concave ngons, resolves T40675
Quiet warning
Resolve memory leask with reports on initialization
Code cleanup: replace 0 with OB_MODE_OBJECT
Transform: PET quick checks to speedup wire-only edge case
Code cleanup: de-duplicate flag check in ED_object_toggle_modes
Code cleanup: replace direct operator calls with ED_object_toggle_modes
Hopefully fix compilation with old MSVC2008/WIN32...
Code cleanup: use bool instead of int
Move tests into tests/ top-level dir
Revert "Fix flickering when transform snapping in edit mode and cursor is"

Looks like the cleanest way to handle this is to no do bounding box collision
for edit mode at all. But this is easy to enforce

This reverts commit 7b5fe4f316234022a0ab761b694cd459ce98db2d.

Conflicts:
	source/blender/editors/transform/transform_snap.c
Fix T40679.

Cleanest way here is not do bounding box collision for editmeshes at
all. Decision is taken because:

* Usually we want to do the snapping to the edited mesh anyway (when we
don't the mesh is skipped completely, so we don't need to worry for
extra checks)

* Bounding box is calculated from derived mesh. This means that for
subsurfed meshes for instance, the bounding box may be significantly
smaller than the size of the edit mesh.
GTest unit testing framework

Currently covers only small set of functionality.
Some WITH_TESTS weer not renamed to WITH_GTEST
Fix T40585, group textures cannot be selected for painting.

Issue here is that if there's a texture in the tree, chances are it has
already been set as active texture so groups are never traversed.

Now changed logic so that if a group node is active, its own active
texture takes priority over the parent group active texture.