Clean-up and fix interfaces, add some examples.