Refactoring and cleanup

- Updated Buffer.
- Updated several examples.
- Work-in-progress, some parts won't compile.