Lighten up blue and add legend.

Refactored and commented the JS a bit. Introduced some sloppy code,
removed some. These files are under pretty active development so
it should get taken care of soon.