Fix examples so that they compile

Modernize a bit, too
More examples fixes

And some cleanup, as well.
More example fixes
Merge pull request #276 from linas/example-fix

Example fix