Adding unit tests and logic to delete state store when deleting an application