If the example contains a docroot and/or approot, use it instead of the source directory

No bashism in the shell script, therefore do not require bash but a bourne shell
Merge pull request #32 from pgquiles/fix-docroot

Fix docroot
a substantial batch of bug fixes and small features improvements (see redmine)
Merge commit 'github/master'
avoid double CSS loading
fix some layout issues
Removed redundant forward class declaration
Made it so the +- 0.5 will work in the CornerImage example.
Ext pointer error fix

Fixed pointer error where we were adding a char to a pchar literal,
returning a pointer to bad memory.

Changed the inner loop to a switch stamement allowing for better
compiler optimization.