Refactor palette loaders.

I specifically moved the file opening/closing logic to the common
code. This makes the code easier to understand for me since there
is less duplication. In fact, this commit removes more lines than
it adds.

Signed-off-by: Warren Turkal <wt@penguintechs.org>
latest commit 33b29c6e8d
Warren Turkal authored