add support for custom _id-s

implementation by @pscanf in pull request #165