use seedrandom.js for pseudorandom numbers
use _.extend if jQuery is not available
added Rtheta gate