removed the extern storage class explicit definition
updated the algorithm, changed the way mongodb documents are updated and added some debug output
added {w:1} write concerns on all write operations where it was missing

Now the database driver waits until the change is written to the HDD.
Also changed the position where the adjustment for each keyword's weight is calculated which seemed to fix the problem with the incorrect weights