Bugfix and rewrote the cookie functions

- Fixed a bug that broke the random function
- Now using the cookie functions of Quirksmode
- And again smaller in size and number of characters