Multiple changes

- Added a wrapper for the KHR_debug extension.
- Moved some of the auxiliary functions into the library.