Refactored out the PCX functions.

Started on a better tile loader