use common file for common funcs.
works with cpu, have to fix Makefile for gpu.
Fixed bug in reading in bignums that was evident in gpu version so the gpu version should now work