Added a lot of BG code in PPU

- Fixed a number of variables in BG drawing/rendering code
- Moved getPal and getColor to their own functions for organization