Fix onFinish getting called to oearly and too many times.

This was caused by the unique path generation not working properly,
generating too few (and invalid) unique paths.
Add a test case for the previously fixed bug.
Fix bug when tracking relation loading on null items.

We don't try to attach relation loading promises to null items anymore.
Update version number. Set npm test command.