improved retrieval of foreground color from attributes dictionary, fixed HR color problem #420
simplified _setForgroundColorInContext with new foregroundColor method.
removed commented-out old code
Fixed coding style
added backgroundColor helper that does the right thing
Cleanup DTCompatibility