Refactoring of code.
WIP: storing nodes to mongodb.