App deletion

All of this should be in a transaction.