Implements Undo functionality and fixes a bug in onDraw.

- Undo implemented, simplified colour state as using the index
  was broken / unnecessary.
- OnDraw shouldn't have been grabbing the last added rect but
  rather the rectangle provided to the method.