Cleaned and tidied up the examples
removed some legacy code
updated the test case
Merge pull request #1241 from alvinsight/dev

Spring clean (well, winter clean) of the examples