Solved some graphical glitches

* Merge shapes with the same color
* Do not render shapes masked by an overlapping shape
My hands are typing things