Update examples

Update the coding style used in the examples and fixes some undesired
behaviors (eg. overwriting versioned files, polluting the directory,
etc.).
Use "xdg-open" instead of "display" to open images in the examples

Always uses the default image viewer (at least on systems following
the Freedesktop.org standards).
Add exec bit and interpreter lines to the examples
Also remove generated files from the examples directory on "make clean"