Fix memory leaks on reload.

The big fix was to de-init the draw module before deallocating it,
which is what frees up textures. There are a lot of smaller fixes
here as well.