Finished rewriting the generation of TikZ code.