Added persistance, fixed clear from command line, cleaned up code.