drawPalette() improvements

Now handles pos %in% 1:4, and is recoded to be easier to read, which
may help in maintenance.  A lot of commented-out and otherwise disabled
code remains.