Added undo functionality

Implemented using a limited stack.
Required a fix to the paper.js library for applying matrices on import