Small improvements to scratchpad drawing

Apart from some general code cleanup, this makes it so that all curves are drawn with bezier quad curves to be smoother and dragging the pen outside the scratchpad and back inside looks better.

Auditors: alex