Fixes for TK object types

* Some config resources changed from strings to integers in Python 2.3
* Using int() should be compatible if Listbox.curselection() ever returns
  integer objects
Make hdllib.Error() into an IOError() exception subclass
Use proper exception classes in other places

* CacheMiss, BadCommandError, NoHandlerError never used
* Have to unpack exception arguments from “args” attribute
Use built-in “assert” statement rather than inventing another
Restore caching, after fixing up exception classes in CacheMgr

Partial revert of commit 7e32809, “More fixes to make this browser work with
e.g. Google Search”.