Fixed warnings obtained on GCC 4.8 with -Wall -pedantic -Wextra
Added BUILD_EXAMPLES option for switching example builds on and off without altering CMakeLists.txt