Misc changes to Assemblies.

- finalize() now recursively calls finalize() on its child assemblies
  as well.  So it only needs to be directly called on the root assembly.
- Added an optimize() method to Assembly.  Currently it does nothing,
  but it serves as a place to optimize the assembly for performance
  and memory usage before being used for rendering.