minor restructuring and renaming

Write explicit export lists for each module, to improve intra-modular
inlining. Rename some functions for consistency.
extend palettes and redraw tiles each frame, to later do effects