Refactor of colour palette handling.

The allocation code needs to be extracted into a new class, so that the
navigation from the project page can be implemented.
Some name changes and interface improvements and more.

Change-Id: I59ec98e71b75882f6a2fbb56c27668c7fffa663c