Convert Raphaël paper objects to JSON and back