more unittests and updated documentation for extensions.  Fixed bug in optimizer that caused blocks to be optimized away under some circumstances.

--HG--
branch : trunk
11 files changed