Added a publicly exposed save() function.