Fix a problem with the random effects - I was missing a cast to byte.

Change the type of many variables to reduce memory usage.

Make effects repeat a random number of times.

Make the swap effect sit at the beginning and end a bit longer.