add autosave mixin

The mixin will call save every time an attribute is set.
Merge pull request #5 from relekang/autosave

add autosave mixin