Fixed memory leaks and updated GameEngine

patched memory leaks and updated text rendering