Moved some of the shape draw functions to library