Major rewrite for speed!

Did a major rewrite to speed things up, and now do a lot of cashing to
make things faster. I hope that I didn’t break anything. :-/ The code
is now approximately 3*times faster and I have added a demo to display
how long time it takes to generate 1000 random symbols.