moved palette load/save into File class and fixed bugs