Fix broken sprite transparency
Cleanup Palette code, added tests