Cleaned up examples

Fixed syntax errors in some examples. Removed some deprecated ones.
However, this folder has to be reviewed again before a release.
Enhanced phpcs configuration
Fixed some coding style issues after phpcs run