Fixed sefault stemming from window.h
Moved memory freeing functions to deconstructors