added #define THREADED

Can easily compile threaded or non-threaded version by changing THREADED
macro in Threaded.h