Extendable Example class.

This moves the reusable UI code to a central class,
allowing examples to simply add nodes and work on
the layout.
Store neighbours as node-set.
Finalize some of the methods and fields.