Refactored the main window so that it now draws a QImage, fixed some general bugs relating to un-needed pointers.