Fix a behavior of undo and redo, and a desgin of the command object.
1.Bug fix: Revert move a span.
2.Bug fix: An undo was not work for do after other undos.
3.Change entitiesPerType from having an array of entities to having a hash of entities.
4.The command object is responsible for undo and redo, and encupsulate history.
5.XxxCommand objects has not only data but also processes.
5-1.XxxCommand objects encapslate their data.
5-2.XxxCommand objects has functions 'execute' and 'revert'.
5-3.XxxCommand log for debug last of execute.
6.Make target ids unique when delete selected elements. command.util.uniq is not necessary yet.
7.Make the second paremeter of command.invoke more simple.