Set sys.path with vtk package path independently of VTK build tree location
Memory leaks associated with ctkSimplePythonShell tests are failure
Fix memory leaks associated with ctkSimplePythonShell tests

* Calling "sys.exit()" within a python script ends up calling the
 function "std::exit()" [1] which terminate the application without calling
the destructor of variables with "automatic storage durations".

Considering the description of such variables [2], calling either
"std::exit()", "exit()" or "sys.exit(0)" from within python will prevent
the destruction of the QApplication singleton hence the proper destruction
of the object where the vtkObject have been instantiated (i.e. ctkTestWrappedVTKSlot and
ctkTestWrappedVTKQInvokable)


[1] http://en.cppreference.com/w/cpp/utility/program/exit
[2] http://en.cppreference.com/w/cpp/language/storage_duration


* To properly terminate the application, the solution consisted in
both running the test script after the event loop has been initiated and
calling "qt.QApplication.exit()" instead of "sys.exit()'. That said,
note that calling "sys.exit()"  in a pure python script is valid since
the implementation of "sys.exit()" takes care of doing the appropriate
cleaning before calling "exit()". [See Py_Finalize(), Py_Exit(), handle_system_exit]
in "pythonrun.c"

* An alternate solution could consist in using the "atexit" python module
and register a cleanup function. [3]

[3] http://docs.python.org/library/atexit.html
Fix segfaults associated with ctkSimplePythonShell tests

* In both "wrappedVTKQInvokableTest.py" and "wrappedVTKSlotTest.py",
a vtkTable was instantiated within python and set to wrapped cpp
instance of either (a) "ctkTestWrappedVTKQInvokable" or (b) "ctkTestWrappedVTKSlot".

Within each on of these classes (a and b), the "Delete" function
was called unconditionally on the MyTable private member. Two problems
were happening:

 - the first instance of vtkTable initially created within the constructor
of classes a and b was leaked.

 - the vtkTable instantiated within python referenced with the "t2"
variable was set to the classes a and b. Then, when python was finalized
it was deleting the object allocated within python. Next, in addition the
Delete function was also called within the destructor of classes a and b.
The pointer being invalid, a seg fault occurred. Using vtkSmartPointer
help us to elegantly address this issue.
Fix segfault when vtkObject observed in python is deleted after interpreter is "ended"

* Added a regression test to illustrate the problem

* The solution consisted in using "Py_Finalize" instead of "Py_EndInterpreter".
This is required because within the method vtkPythonCommand::Execute, the method
is a no-op if "Py_IsInitialized" returns 0.
Merge branch 'ensure-python-is-finalized'

* ensure-python-is-finalized:
  Fix segfault when vtkObject observed in python is deleted after interpreter is "ended"
  Fix segfaults associated with ctkSimplePythonShell tests
  Fix memory leaks associated with ctkSimplePythonShell tests
  Memory leaks associated with ctkSimplePythonShell tests are failure
  Set sys.path with vtk package path independently of VTK build tree location
Facilitate maintenance of the code by converting ctkAbstractPythonManagerTest1 to use ctkTest
Provide mechanism to set PythonQt initialization flags.

* Note that by default PythonQt::IgnoreSiteModule and  PythonQt::RedirectStdOut
are set.
Merge branch 'initialize-method-for-pythonqt-flags'

* initialize-method-for-pythonqt-flags:
  Provide mechanism to set PythonQt initialization flags.
  Facilitate maintenance of the code by converting ctkAbstractPythonManagerTest1 to use ctkTest
Fix spelling error in progress message
Simplify API adding convenience initialize method to python manager

* In order to initialize the python manager, calling mainContext has to be
called. This wasn't easy to guess. The new initialize method allow
now to explicitly initialize the manager.
Merge branch 'add-python-manager-initialize-method'

* add-python-manager-initialize-method:
  Simplify API adding convenience initialize method to python manager
Add logger messages if database operation fails
Enable re-inserting patient after deleting

Handle conditions where efficiency variables were preventing
image from being re-inserted in the databases (since the patient,
series, and study matched the last ones inserted).
Prevent confusion by moving code related to build system under CMake dir
Merge branch 'move-lastconfigure-step-under-cmake-dir'

* move-lastconfigure-step-under-cmake-dir:
  Prevent confusion by moving code related to build system under CMake dir
Prevent confusion removing variable CTEST_CMAKE_COMMAND in driver script template.

* To summarize:
   - This variable was using in "old-style" ctest script.
   - Its value is only readonly.

* For reference consider reading: http://www.cmake.org/Bug/view.php?id=13080
Merge branch 'remove-unused-variable-driver-script-template'

* remove-unused-variable-driver-script-template:
  Prevent confusion removing variable CTEST_CMAKE_COMMAND in driver script template.
Prevent error remove CTEST_CMAKE_COMMAND from the list of required variable.
Merge branch 'remove-unused-variable-driver-script-template'

* remove-unused-variable-driver-script-template:
  Prevent error remove CTEST_CMAKE_COMMAND from the list of required variable.