Cleaned up main() code

moved a bunch of code from main() to CanvasRenderer() so main has very
little code now.