Started working on threading and thread-safety thingies.