Added capability to identify beans by string.

Also refactored the code base:
- Separated container construction from resolving logic.
- Factories are now dependent on a resolver at object creation time
  instead of at factory instantiation time.
- Reduced unneeded usage of mutable state.