basicly working version, threaded, no source tokenization structs
remove unused functions