Add save and restore riffa api
Fix incorrect initilization in riffa wrapper