Merge pull request #1 from damoxc/master

model: fix saving with a compound key
swapped order of asign
simplified and extended tests
multiple document test