Painting functionality.

Added painting with undo/redo functionality.

I'll add some javadocs later, too tired to do it now, or after the erase functionality is also implemented.