Refactoring and cleanup

- Reimplemented basic error handling.
- Updated error handling in Renderbuffer and Framebuffer.
- Work-in-progress, won't compile.