Threading figured out. First commit which supports Threading.