Added palette class

Other misc. changes