add autosave mixin

The mixin will call save every time an attribute is set.

fix #4