Better implementation of autoIncrement

Before this patch id === null was required for autoIncrement ids.
This patch also accepts id === undefined
Merge pull request #41 from manuels/patch-2

Better implementation of autoIncrement