Moved common renderer functionality into rd-common/ folder

Moved common functionality such as font code and image handling code into an rd-common/ folder. Also fixed a few bugs along the way.