Overhaul some dedupe/attribution of duplicates.
New Record Fixes.
Merge remote-tracking branch 'origin/m2m' into dmitry-fixes

Conflicts:
	server/lib/dre/index.js
working (progress on uploading record without breaking)
Merge pull request #132 from amida-tech/dmitry-fixes

Dmitry fixes