Draft expandable tool API.

The current tool is now an object and mouse events will be send to that object. This should prevent us from writting one big switch statement in apply function. Changed pen and eraser tools to work in this way.