Initial import - working threaded code.

There's no protection of globals, so the individual Run functions overwrite each other.