First batch of examples cleaned up

Mostly cosmetic improvements
More clean-up
Even more clean-up
Merged dev into examples-clean-up
Merge pull request #577 from anissen/examples-clean-up

Clean up code for examples