Refactoring and cleanup

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