Implemented iterator to prevent deadlocks

Because node.js is event-driven the callbacks will run asynchronously
and that means deadlocks will be encountered in Neo4j. Implemented
iterators to ensure sequential writes to the database while importing.