fix miss incorrect labelling of sub panes
fixed a syntax error in the slate.Range
fixed ast.Command function restore issues

There was a bug with the index used for iterating over the parameters.
I was failing to store the functions, when the functions were being
stored, as the length property was missing.

It was also failing to store the name of the command, for the new
version that gets generated. This is now correctly copied across.