Refactors code and sets _id to undefined again
Refactors tests by extracting mongodb test functionaly and switches to chai