Implements most of the necessary changes to use frame buffers. Next step: use the output!