Fixed compilation errors.
Fixed segfault.
Corrected mutex initialization.
Wrote resolve function.
Wrote code for starting resolution threads.
Wrote cleanup code.