Some of these are pure token optimizations, some spend tokens for performance. Function calls are particularly expensive in Pico-8, so using the table form of `pal` whenever changing multiple colors seems worth it.
Also fixes a bug in palette swapping.