Rework dumping functions

Changes:
  * Add comments to explain the dumping code
  * Add support for dumping values of any type (as '<' <type> '>')
  * Add support for tables as keys in dump2()
  * Make dump2() return it's result (like dump()) rather than printing it
  * Simplify and optimize function serialization via serialize()
Sort commands and privs alphabetically in '/help'.

Also make a stray variable local.