fix issue where custom `idAttribute` was causing dupes.

use model's 'idAttribute' as default main index if supplied.

Fix for #19 and #20.