Save associations as array

Fixes #31.