Add undo purchase support

Closes #34