Class lookup order change and code blocks referencing defined types.

- Classes are looked up from the deepest class loader first when
  loading classes (instead of top-most)
- Allow code blocks to reference defined types by implementing
  INameEnvironment.