moved threads.sh to lib; initial commit of gr.sh