Refactored painting into BufferedTerminal/Screen.

BufferedScreen can be reused, for example with a different output
device.
Working on threads. (WIP)