Fix bug 1030797

* attempt update before insertion for register (since delete
  doesn't seem to always work right)
Collapse commands to most recent only.

* Prevent command queue from getting flooded.
* NOTE: no cmd filtering being done on client (TODO to fix this)
Merge branch 'master' into dev