Use C++11 unique pointer, add Graphics class for flushing buffers