move some of the drawing utility routines out into their own js file