Added additional Scan Chain stuff and changed the rng to be long long. Also, moved the polynomial storage into the rng, as it seems more natural.