Add paper.zpd('save') event and refactor zpd event code