Overhauled drawing code (again)
Also some reorganizing