refactor some engine object code related to rendering; add a button to toggle debug view