changed method of clearing history

I had to change it to this because I was using a reference to
commandHistory in the system namespace and setting it to a literal
creates a new reference. Setting the lenght to zero removes all
elements but keeps the same reference.