Updated testing framework: randomness, constant cursor position, test type labeled.
Cleaned up code and added comments.