Make gray colors more consistent [#37]

Also do some other fixes and refactoring.