Fix cosTheta by testing, Fix multiprocessing, Add unit tests

make syntax python3 compatible, standards compliant. Still need pika
for python3, 2to3 will take care of classname changes. fixed global
variable assignment