Add pause/resume and fix raphael bugs