Moved code dealing with the Canvas into its own object.

This allows us to use a handy function when referring to Canvas elements, and allows us to change details in runtime.
Signed-off-by: Nassar Zeitoune <nassar.z@slair.com.au>