merged two similar functions together, added test
made thread safe
improved get()
node->key rename for consistency