Added a remove option to interactive mode. Interactive mode was improved a little. Some other code was tidied up.
rand() only needs to be seeded once
Make some stuff static